Bird
0
0

Why does Spring Boot use proxies to implement @Async methods instead of directly modifying the method code?

hard📝 Conceptual Q10 of 15
Spring Boot - Async Processing
Why does Spring Boot use proxies to implement @Async methods instead of directly modifying the method code?
AProxies make the method run faster than direct calls
BDirect method modification is impossible in Java
CProxies allow Spring to add async behavior without changing the original method code
DSpring Boot does not use proxies for @Async methods
Step-by-Step Solution
Solution:
  1. Step 1: Understand proxy-based async implementation

    Spring uses proxies to intercept method calls and run them asynchronously without altering original code.
  2. Step 2: Evaluate options

    Proxies allow Spring to add async behavior without changing the original method code correctly explains why proxies are used for @Async.
  3. Final Answer:

    Proxies allow Spring to add async behavior without changing the original method code -> Option C
  4. Quick Check:

    Spring uses proxies to add async behavior [OK]
Quick Trick: Spring proxies add async without code changes [OK]
Common Mistakes:
  • Thinking direct code modification is impossible
  • Believing proxies speed up method calls
  • Assuming Spring does not use proxies

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes