← 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 read values from property files into fields?

    Answer: @Value

    @Value injects values from properties files, environment variables, or Spring Expression Language (SpEL) expressions into bean fields.

  2. What does @Lazy do when applied to a Spring bean?

    Answer: Delays bean initialization until it is first requested

    @Lazy defers the creation of a singleton bean until it is first accessed rather than at container startup.

  3. What Spring feature enables component scanning to detect annotated classes automatically?

    Answer: @ComponentScan

    @ComponentScan tells Spring to scan specified packages for classes annotated with @Component, @Service, @Repository, and @Controller.

  4. What is the SpEL expression to access an environment variable named 'MY_VAR' in Spring?

    Answer: @Value("${MY_VAR}")

    The ${} syntax in @Value resolves property placeholder values including environment variables registered in Spring's Environment.

  5. Which scope creates a new bean instance for every HTTP request?

    Answer: request

    The 'request' scope creates a new bean instance for each HTTP request and is only valid in a web-aware Spring ApplicationContext.

  6. What annotation is used to register a method's return value as a Spring bean in a @Configuration class?

    Answer: @Bean

    @Bean is placed on methods inside @Configuration classes to indicate that the returned object should be registered as a bean in the Spring application context.

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