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

A Spring application requires constructor-based dependency injection for a mandatory dependency. Which approach is best?

Q.2Medium

What is the default scope of a Spring Bean?

Q.3Medium

Which of the following best describes IoC (Inversion of Control) in Spring?

Q.4Medium

A developer needs to inject a bean only if it exists, otherwise skip injection. Which annotation should be used?

Q.5Medium

What is the role of ApplicationContext in Spring Framework?

Q.6Medium

Which annotation is used to define configuration classes in Spring that replace XML configuration?

Q.7Medium

Consider a scenario where multiple beans of the same type exist. How can you specify which bean to inject?

Q.8Medium

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

Q.9Medium

A Spring Boot application starts with ClassPathXmlApplicationContext('application.xml'). What does this do?

Q.10Medium

Which Spring concept ensures that the same bean instance is reused throughout the application lifecycle?

Q.11Medium

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

Q.12Medium

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

What is the role of PropertySource annotation in Spring Framework?

Q.14Medium

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

Q.15Medium

What is the function of the BeanFactory interface in Spring?

Q.16Medium

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

Q.17Medium

What does the @Transactional annotation do in Spring?

Q.18Medium

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

Q.19Medium

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

Q.20Medium

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