2v0-7222 Exam QuestionsBrowse all questions from this exam

2v0-7222 Exam - Question 71


Which two statements describe the ApplicationContext correctly? (Choose two.)

Show Answer
Correct Answer: C,E

The ApplicationContext can be created in various environments, including test environments, web applications, and standalone applications, demonstrating its flexibility and adaptability. Additionally, it maintains singleton beans that are instantiated by the Spring runtime by default, ensuring efficient resource management. These characteristics make it a highly versatile and robust container within the Spring framework.

Discussion

3 comments
Sign in to comment
50513d6Options: CE
Jan 27, 2024

A. Incorrect - The ApplicationContext is not the root interface for accessing the Spring container. The root interface is BeanFactory. ApplicationContext is a subinterface of BeanFactory and provides additional functionalities. B. Incorrect - The ApplicationContext eagerly initializes beans by default. If you want lazy initialization, you need to explicitly configure it. C. Correct - The ApplicationContext can indeed be created in various environments, including test environments, web applications, and standalone applications. Different implementations of ApplicationContext are available for different use cases. D. Incorrect - The ApplicationContext includes all the functionality of the BeanFactory and provides additional features. It is a more feature-rich container compared to BeanFactory. E. Correct - The ApplicationContext does maintain singleton beans that are instantiated by the Spring runtime. Singleton scope is the default scope for beans in the ApplicationContext.

GlothanOptions: AC
Dec 20, 2023

Option A is correct. The ApplicationContext is the root interface for accessing the Spring IoC container. It provides the functionality of the BeanFactory and adds additional features like event propagation, AOP integration, and more. Option E is incorrect. While the ApplicationContext can manage singleton beans, it also supports other bean scopes like prototype, request, and session. The maintenance of singleton beans does not exclusively define the ApplicationContext.

50513d6
Jan 27, 2024

So ApplicationContext is not the root interface, BeanFactory is. C and E is correct imo

2211094Options: CE
Jun 19, 2024

CE is correct answer.