Loading
Spring Beans and Beans Life Cycles

Q1.

What exactly is a Spring Bean?

A. A special class written by Spring
B. A Java object managed by IoC container
C. A servlet in Spring Boot
D. A configuration file

Q2.

What is the default bean scope in Spring?
A. Prototype
B. Singleton
C. Request
D. Session

Q3.

In which phase is @Autowired executed?
A. Instantiation
B. Initialization
C. Before Destroy
D. After Destroy

Q4.

Which annotation marks a class to be auto-detected as a Bean?
A. @Bean
B. @Autowired
C. @Component
D. @Entity

Q5.

Which method is used for bean cleanup?

A. @PostConstruct
B. @Bean
C. @PreDestroy
D. @Autowired