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

Which of the following correctly describes the lifecycle of a singleton-scoped Spring bean?

Q.22Easy

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

Q.23Medium

In a Spring Boot application, what does the @SpringBootApplication annotation combine?

Q.24Medium

Consider a scenario where you have two bean implementations of the same interface. How would you specify which one to inject using Spring annotations?

Q.25Medium

What is the role of PropertySource annotation in Spring Framework?

Q.26Medium

In Spring Data JPA, what does the @Repository annotation signify?

Q.27Easy

What is the primary advantage of using Spring Dependency Injection over manual object creation?

Q.28Hard

How does Spring handle circular dependency between two beans?

Q.29Medium

What is the function of the BeanFactory interface in Spring?

Q.30Medium

In Spring AOP, what does the term 'Join Point' refer to?

Q.31Medium

What does the @Transactional annotation do in Spring?

Q.32Hard

An enterprise application requires different bean implementations based on runtime conditions. Which Spring feature is most suitable?

Q.33Medium

What is the significance of the @ConfigurationProperties annotation in Spring Boot?

Q.34Hard

Consider a Spring application where method execution time tracking is required across multiple methods. Which approach is most appropriate?

Q.35Easy

What is the default behavior of Spring when multiple beans of the same type are available for autowiring?

Q.36Hard

In Spring framework, what is the purpose of FactoryBean interface?

Q.37Medium

What does the @EnableCaching annotation enable in a Spring application?

Q.38Medium

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

Q.39Medium

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

Q.40Easy

Which annotation is used to mark a class as a Spring Bean in the latest Spring Framework 6.0?