← All Spring Framework Flashcard Decks

Spring Core & Dependency Injection Flashcards

6 cards from real Spring Framework practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 6 Spring Core & Dependency Injection flashcards as text
  1. Which Spring annotation is used to mark a class as a Spring-managed component?

    Answer: @Component

    @Component is the generic stereotype annotation that marks a class as a Spring-managed bean eligible for component scanning.

  2. What is the default bean scope in Spring Framework?

    Answer: singleton

    By default, Spring beans are singletons, meaning the IoC container creates exactly one instance of the bean per Spring container.

  3. Which annotation is used to inject dependencies in Spring?

    Answer: @Autowired

    @Autowired is Spring's annotation for automatic dependency injection by type into fields, constructors, or setter methods.

  4. What does the @Configuration annotation indicate in Spring?

    Answer: The class is a source of bean definitions

    @Configuration marks a class as a source of bean definitions, allowing @Bean methods to be declared inside it for the Spring IoC container.

  5. In Spring, what is the difference between constructor injection and setter injection?

    Answer: Constructor injection enforces mandatory dependencies at creation time; setter injection allows optional wiring

    Constructor injection makes dependencies mandatory and supports immutability, while setter injection is used for optional dependencies that can be changed after object creation.

  6. What is the ApplicationContext in Spring Framework?

    Answer: An advanced IoC container that adds enterprise features on top of BeanFactory

    ApplicationContext is Spring's advanced IoC container that extends BeanFactory with features like event publishing, i18n, and AOP integration.

How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. Exam facts are checked against the official sources listed below. Not reviewed by a subject-matter expert. Editorial policy

Sources & references

Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy

  1. docs.broadcom.com — Test delivery, retake policy, exam information · verified Oct 2026
  2. spring-academy.broadcom.com — Eligibility · verified Oct 2026
  3. broadcom.com — Fees, exam format, passing score, time limit · verified Oct 2026