adspace


What is the difference between singleton and spring singleton?

Answer Posted / Anuj Sindhu

Singleton is a Java design pattern that ensures a class has only one instance. Spring's singleton, on the other hand, creates a single instance of a bean within the application context. The key difference lies in their lifecycle management, which is handled by Spring for singletons.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you inject java collection in spring?

518


What is difference between @controller and @restcontroller in spring?

556


What is lazy class?

490