Java-based configuration option enables users to write most of their Spring configuration without XML but with the help of few Java-based annotations.
Example:
Annotation @Configuration indicates that the class can be used by the Spring IoC container as a source of bean definitions. The @Bean annotation tells Spring that a method annotated with @Bean will return an object that should be registered as a bean in the Spring application context.