Bean scope
it's of five type:
a)singleton
a)singleton
b)prototype
c)session
d)requests
e)global session
-> singleton is by default. so the hash code of all singleton object will be same.
it can be changed in two ways:
1)In config file: <bean class ="" name="" scope=""/>
2)Under @Component
@Scope("") scope is only used with component.
->prototype: every time new object is give and has different hash code
Comments
Post a Comment