Posts

Showing posts from September, 2024

T4 Spring boot wings 1

Spring Boot MCQ 1. Spring Boot Annotations MCQs Annotations simplify development by reducing the need for configuration. The questions in this section revolve around various Spring Boot annotations and their usage in real-world applications. ### 1. **What is the purpose of `@SpringBootApplication` in a Spring Boot application?** - A) It enables Spring Security. - B) It marks the main class for auto-configuration, component scanning, and configuration properties. - C) It disables embedded server. - D) It configures Hibernate. **Answer:** B) It marks the main class for auto-configuration, component scanning, and configuration properties. ### 2. **Which annotation is used to define a Spring-managed bean?** - A) `@Component` - B) `@Service` - C) `@Bean` - D) All of the above **Answer:** D) All of the above ### 3. **Which annotation is used to inject dependencies in Spring Boot?** - A) `@Autowired` - B) `@Inject` - C) `@Resource` - D) ...