What is a Spring Bean?

What is a Spring Bean?

A) An object that is managed by the Spring IoC container
B) A type of Java EE application server
C) A special type of database entity
D) A configuration file for Spring

Answer:

A) An object that is managed by the Spring IoC container

Explanation:

A Spring Bean is an object that is managed by the Spring IoC container. These beans are the backbone of a Spring application, as they are the objects that form the building blocks of the application and are managed by Spring’s container.

Beans are typically created, configured, and managed by the IoC container, which handles their lifecycle from instantiation to destruction. They can be defined in configuration files (like XML) or annotated in the code (e.g., using @Component, @Service, or @Repository annotations).

Reference links:

https://www.javaguides.net/p/spring-tutorial-beginners-to-expert.html

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top