Bird
0
0

What is the main purpose of the @Scheduled annotation in Spring Boot?

easy📝 Conceptual Q11 of 15
Spring Boot - Async Processing
What is the main purpose of the @Scheduled annotation in Spring Boot?
ATo run a method automatically at fixed intervals or times
BTo mark a method as a REST endpoint
CTo inject dependencies into a class
DTo configure database connections
Step-by-Step Solution
Solution:
  1. Step 1: Understand the role of @Scheduled

    The @Scheduled annotation is used to mark methods that should run automatically on a schedule without manual calls.
  2. Step 2: Compare with other options

    Options A, C, and D relate to other Spring features like REST, dependency injection, and database setup, not scheduling.
  3. Final Answer:

    To run a method automatically at fixed intervals or times -> Option A
  4. Quick Check:

    @Scheduled = automatic method run [OK]
Quick Trick: Remember: @Scheduled means automatic timed method run [OK]
Common Mistakes:
  • Confusing @Scheduled with REST or dependency injection annotations
  • Thinking @Scheduled configures databases
  • Assuming @Scheduled requires manual method calls

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes