I have following two beans in the xml context. I want to know whether the underlying objects denoted by these 2 beans remains the same or different? In case of String its the same one. What about with spring? Can anybody let me know on this...
If you define two beans of the same type, each with the default singleton scope, then two distinct instances of that type will be registered with Spring's IoC container.
It can be a cause of some headaches if you auto-wire your beans by type, though.
Does that answer your question?
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.