Spring puts each bean instance in a scope. What is the default scope? (Choose the best answer.)
Suggested Answer: B
Get Premium 2V0-72.22 Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
Spring supports different scopes for bean instances, such as singleton, prototype, request, session, etc. The scope determines how many instances of a bean are created and how they are shared among other components. The default scope is singleton, which means that only one instance of a bean is created per application context and it is shared by all components that depend on it.
15 comments · newest first
LE
Leila
2 months ago
I still feel prototype has its place in certain cases.
ER
Eric
2 months ago
Exactly! Less overhead with singleton.
RE
Renay
2 months ago
True, but singleton is the default in Spring.
LE
Leila
3 months ago
But what about prototype? It’s useful for unique instances.
ER
Eric
3 months ago
Agreed! Singleton is efficient for shared resources.
RE
Renay
3 months ago
I think the default scope is singleton. It makes sense for most beans.
ZO
Zona
3 months ago
I always get confused with these scopes!
LO
Louis
3 months ago
Nope, definitely singleton.
VI
Vicki
3 months ago
Wait, are you sure? I thought it was prototype.
DO
Donte
4 months ago
Totally agree, it's singleton by default.
RO
Romana
4 months ago
The default scope is singleton!
BI
Billye
4 months ago
I remember discussing scopes in class, and I think singleton was mentioned as the default. I hope that's right!
AN
Andree
4 months ago
I’m a bit confused. I thought prototype was the default scope, but now I’m second-guessing myself.
JA
Jacquline
4 months ago
I practiced a similar question last week, and I believe the answer is definitely singleton. It just makes sense for Spring.
LI
Lizette
4 months ago
I think the default scope is singleton, but I'm not entirely sure. I remember something about it being the most common.