What is difference between singleton and prototype bean?

Prototype scope = A new object is created each time it is injected/looked up. It will use new SomeClass() each time.

Singleton scope = (Default) The same object is returned each time it is injected/looked up. Here it will instantiate one instance of SomeClass and then return it each time.

See also:

  • Spring Bean Scopes

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)