Bird
0
0

What is the main purpose of the @EnableAsync annotation in a Spring Boot application?

easy📝 Conceptual Q11 of 15
Spring Boot - Async Processing
What is the main purpose of the @EnableAsync annotation in a Spring Boot application?
ATo enable automatic database transactions
BTo enable REST API endpoint scanning
CTo enable running methods asynchronously in the background
DTo enable security features like authentication
Step-by-Step Solution
Solution:
  1. Step 1: Understand what @EnableAsync does

    This annotation activates Spring's ability to run methods asynchronously, meaning in the background without blocking the main thread.
  2. Step 2: Compare with other options

    Other options relate to transactions, REST scanning, or security, which are unrelated to @EnableAsync.
  3. Final Answer:

    To enable running methods asynchronously in the background -> Option C
  4. Quick Check:

    @EnableAsync = run methods asynchronously [OK]
Quick Trick: Remember: Enable async means run tasks in background [OK]
Common Mistakes:
  • Confusing @EnableAsync with transaction management
  • Thinking it enables REST endpoints
  • Assuming it controls security features

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes