← Quiz: Creational Patterns in Java: all 10 questions
Quiz: Creational Patterns in Java · Question 10 of 10
Which statement about Singletons in Spring Boot applications is correct?
Which statement about Singletons in Spring Boot applications is correct?
- A.You must write a private constructor for every service
- B.Spring beans are singletons by default, and they are injected, so hand-written Singletons are rarely needed
- C.Spring does not allow singleton objects
- D.Every request creates a new service object by default
Answer & explanation
Correct answer: Spring beans are singletons by default, and they are injected, so hand-written Singletons are rarely needed
The default bean scope is singleton, and injection keeps classes testable.
Can you get the rest right without peeking?
Take the timed Quiz: Creational Patterns in Java quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →