What does the @SpringBootApplication annotation do? @SpringBootApplication एनोटेशन क्या करता है?
@SpringBootApplication is a convenience meta-annotation that combines three annotations: @Configuration, which marks the class as a source of bean definitions; @EnableAutoConfiguration, which triggers auto-configuration; and @ComponentScan, which scans the current package and sub-packages for Spring-managed components.
Placing it on the main class means a single annotation sets up configuration, auto-configuration, and component scanning together, which is why the main application class is conventionally placed in the root package.
@SpringBootApplication
// equivalent to:
// @Configuration
// @EnableAutoConfiguration
// @ComponentScan
public class DemoApplication { }@SpringBootApplication एक कन्वीनियंस मेटा-एनोटेशन है जो तीन एनोटेशन को मिलाता है: @Configuration, जो क्लास को बीन डेफिनिशन के स्रोत के रूप में चिह्नित करता है; @EnableAutoConfiguration, जो ऑटो-कॉन्फिगरेशन को ट्रिगर करता है; और @ComponentScan, जो वर्तमान पैकेज और सब-पैकेजेज़ में स्प्रिंग-मैनेज्ड कंपोनेंट्स को स्कैन करता है।
इसे मुख्य क्लास पर लगाने से एक ही एनोटेशन कॉन्फिगरेशन, ऑटो-कॉन्फिगरेशन और कंपोनेंट स्कैनिंग को एक साथ सेट कर देता है।
@SpringBootApplication
// equivalent to:
// @Configuration
// @EnableAutoConfiguration
// @ComponentScan
public class DemoApplication { }Was this answer clear?