s1 and s2 will point to same string Priyam which has been created and exists in the pool at the time when you declared s1=Priyam.
Hope you gugs got it. Can anyone tell what is the limit for the wrapper classes values for the refernces return true???
here is the basic rule Two instances of the followin wrapper objects will always be == (means return true) when the "primitives "values" " are same
3. Character from \u0000 to \u007f
4. Short and Integer from -128 to 127
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton