Quiz: Spring Core Questions
Browse questions from Quiz: Spring Core. Each question has options and an explanation.
Questions — Page 1 of 2
- What does Inversion of Control mean in Spring?
- Spring IoC reduces direct dependency construction with new in application classes.
- Which bean scope is the default in Spring?
- Prototype is the default Spring bean scope.
- Which annotation commonly runs initialization logic after dependency injection?
- @PreDestroy is used for cleanup before a bean is destroyed.
- Why is constructor injection usually preferred for required dependencies?
- Constructor injection hides required dependencies better than field injection.
- A service cannot work without its repository and payment client. What injection style gives the clearest fail-fast design?
- You need to warm up a cache after Spring injects all dependencies. Where should this setup logic commonly go?