@Bean | Spring Annotation | Spring boot

Опубликовано: 13 Февраль 2026
на канале: Campus Learn
1,487
33

#shorts

what is a bean? In Spring Boot, a bean is an object that's managed by the Spring container. Beans can be used to provide configuration, perform actions, or simply hold data.

Now, the @Bean annotation is used to mark a method that produces a bean to be managed by the Spring container. By default, the name of the bean will be the same as the method name, but you can also specify a custom name using the name attribute.

One of the great things about @Bean is that it allows you to create and configure beans in a way that's easy to understand and maintain. You can use @Bean to create beans with dependencies, configure properties, and even provide custom initialization and destruction methods.

#springboot #springboottutorial #java #annotations #springboottutorial #interview #backenddeveloper #interviewtips #dsa #datastructureandalgorithm #systemdesign #restfulapi #restfulwebservice #programming #coding