What is difference between singleton and prototype bean?



What is difference between singleton and prototype bean?..

Answer / 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

More Spring Framework Interview Questions

What is the difference between spring mvc and spring rest?

1 Answers  


What is spring controller?

1 Answers  


What is crud in spring?

1 Answers  


Is spring easy to learn?

1 Answers  


How to do setter injection in spring using annotations?

1 Answers  


Does closing connection close resultset?

1 Answers  


What is the use of spring dao module?

1 Answers  


What is rowmapper in spring jdbc?

1 Answers  


What does autowired mean?

1 Answers  


What is spring in java?

1 Answers  


What is delegatingvariableresolver?

1 Answers  


Can we extend pojo class?

1 Answers  


Categories