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.21Medium

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

Q.22Medium

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

Q.23Medium

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

Q.24Medium

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

Q.25Medium

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

Q.26Medium

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

Q.27Medium

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

Q.28Medium

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

Q.29Medium

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

Q.30Medium

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

Q.31Medium

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