iGET

Java Programming - MCQ Practice Questions

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

951 questions | 100% Free

Q.441Medium

Consider the following code: List<String> fruits = Arrays.asList("apple", "banana", "cherry"); fruits.removeIf(s -> s.length() > 5); What will be the contents of 'fruits' list after execution?

Q.442Medium

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

Q.443Medium

What is the default scope of a Spring Bean?

Q.444Medium

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

Q.445Medium

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

Q.446Medium

What is the role of ApplicationContext in Spring Framework?

Q.447Medium

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

Q.448Medium

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

Q.449Medium

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

Q.450Medium

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

Q.451Medium

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

Q.452Medium

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

Q.453Medium

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

What is the role of PropertySource annotation in Spring Framework?

Q.455Medium

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

Q.456Medium

What is the function of the BeanFactory interface in Spring?

Q.457Medium

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

Q.458Medium

What does the @Transactional annotation do in Spring?

Q.459Medium

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

Q.460Medium

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