PrepZone Logo
PrepZone
Back to Spring Boot

Spring Boot · Easy

Explain the use of @Configuration and @Bean annotations.

Spring BootAnnotations & ConfigJava ConfigFresherSenior

Answer preview

Overview: @Configuration marks a class as a source of bean definitions. Spring processes it with CGLIB proxying to ensure that @Bean methods always return the same singleton bean instance (even when called multiple times).…