iGET

Java Programming - MCQ Practice Questions

Java interviews and campus tests lean heavily on object oriented behaviour rather than API recall. This set covers inheritance and polymorphism, interfaces and abstract classes, the collections framework, exception handling, multithreading, string handling, and JVM basics such as garbage collection. Output based questions are included because they expose the gaps that theory questions hide.

951 questions | 100% Free

Q.461Medium

When would you use request-scoped beans in a Spring web application?

Q.462Medium

What is the difference between constructor injection and setter injection in Spring?

Q.463Medium

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

Q.464Medium

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

Q.465Medium

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

Q.466Medium

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

Q.467Medium

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

Q.468Medium

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

Q.469Medium

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

Q.470Medium

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

Q.471Medium

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

Q.472Medium

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