iGET

Java Programming - MCQ Practice Questions

Practice free Java Programming multiple-choice questions with detailed answers and explanations. Perfect for competitive exam preparation.

958 questions | 100% Free

Q.941Easy

What is the primary purpose of the ApplicationContext in Spring Framework?

Q.942Easy

Which of the following is NOT a valid Spring Bean scope in Spring Framework 2024?

Q.943Medium

In Spring Framework, what does the @Autowired annotation do when autowiring candidates are ambiguous?

Q.944Medium

What is the difference between @Bean and @Component annotations in Spring?

Q.945Medium

Consider a scenario where a Spring application needs to initialize a database connection pool at startup. Which method should be used?

Q.946Medium

What is the role of Spring's PropertyPlaceholderConfigurer in application configuration?

Q.947Medium

In Spring Framework, which interface represents a factory pattern implementation for creating objects?

Q.948Medium

What happens when @Lazy annotation is applied to a singleton bean in Spring?

Q.949Medium

Which annotation is used to provide external configuration properties to Spring beans in the 2024 Spring Boot version?

Q.950Hard

What is the primary difference between BeanFactory and ApplicationContext in Spring?

Q.951Hard

In a complex Spring application, when would you prefer to use ObjectFactory<T> over direct bean injection?

Q.952Medium

What is the significance of the @Qualifier annotation when used alongside @Autowired in Spring?

Q.953Hard

Consider a Spring application where you need different bean implementations based on the deployment environment. Which approach is most suitable?

Q.954Easy

What does the @Scope annotation with value 'prototype' mean in Spring Framework?

Q.955Medium

In Spring Framework 6.0, what is the role of the @EnableAutoConfiguration annotation in Spring Boot?

Q.956Medium

What is the purpose of using @Bean method parameters in Spring @Configuration classes?

Q.957Easy

Which of the following best describes the purpose of Spring's Stereotype annotations (@Service, @Repository)?

Q.958Hard

In a multi-threaded Spring application with singleton beans, what thread-safety consideration must be kept in mind?