adspace
What is difference between singleton and prototype bean?
Answer Posted / Pratigya Chaudhary
A Singleton Bean in Spring Framework is created only once per Spring container, while a Prototype Bean is created every time it is requested. This makes Singletons suitable for objects that are expensive to create but don't change during the application lifecycle, whereas Prototypes are suitable for objects that can be modified or recreated as needed.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers