Why Spring Boot Application class needs to have @Configuration annotation? : <p>I am learning about the Spring Framework but I can't understand what exactly the <code>@Configuration</code> annotation means and which classes should be annotated so. In the Spring Boot docs it is said that the Application class should be <code>@Configuration</code> class.</p>

<blockquote>
  <p>Spring Boot favors Java-based configuration. Although it is possible
  to call SpringApplication.run() with an XML source, we generally
  recommend that your primary source is a @Configuration class.</p>
</blockquote>

<p>Trying to learn about <code>@Configuration</code> I find that annotating a class with the <code>@Configuration</code> indicates that the class can be used by the Spring IoC container as a source of bean definitions. </p>

<p>If that is so then how is this application class a source of bean definitions?</p>

<pre><code>@SpringBootApplication // same as @Configuration @EnableAutoConfiguration @ComponentScan
public class App 
{
    public static void main(String[] args) throws Exception {
        SpringApplication.run(App.class, args);    
    }
}
</code></pre>

<p>I have pretty much understood most other basic concepts regarding Spring but I can't understand the purpose of <code>@Configuration</code> or which classes should be <code>@Configuration</code> classes? Can someone please help. Thanks !!</p>
