What is the difference between singleton and spring singleton?



What is the difference between singleton and spring singleton?..

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

More Spring Framework Interview Questions

Why do we use @qualifier?

1 Answers  


What is the use of application server?

1 Answers  


Explain the function of @autowired annotation.

1 Answers  


What are benefits of spring framework?

1 Answers  


What is namedparameterjdbctemplate in spring?

1 Answers  


Can we have both constructor and setter injection?

1 Answers  


What are the minimum settings to create a spring mvc application?

1 Answers  


What is applicationcontextaware in spring?

1 Answers  


What are the layers in spring framework?

1 Answers  


What is repository pattern?

1 Answers  


How does @transactional works in spring?

1 Answers  


What is root context in spring?

1 Answers  


Categories