What is the difference between singleton and prototype bean?



What is the difference between singleton and prototype bean?..

Answer / Muin Ahmad Khan

Singleton Beans are defined as a single instance per Spring IoC container. When a new bean is required, the existing one is returned from the Spring container's cache. Prototype Beans are created every time a new bean is requested. This means that each request will result in a new object instance.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Spring Framework Interview Questions

Are spring annotations inherited?

1 Answers  


Does spring framework support all joinpoints?

1 Answers  


What is spring architecture?

1 Answers  


What is @enableautoconfiguration in spring boot? : Spring Boot

1 Answers  


What is the benefit of spring boot? : Spring Boot

1 Answers  


Write about the different types of listener related events?

1 Answers  


What is namedparameterjdbctemplate in spring?

1 Answers  


What is spring rest?

1 Answers  


What is ioc or dependency injection?

1 Answers  


What is the advantage of dependency injection in spring?

1 Answers  


What does @component do in spring boot? : Spring Boot

1 Answers  


Explain bean in spring?

1 Answers  


Categories