Originally posted by lalit mishra:
Byte b1 = new Byte("127");
if(b1.toString()==b1.toString())
System.out.println("True");
else
System.out.println("false");
How do this returns false???
Hi, Guys . i saw the Question. i Worked and i surprise to see the ans is false. then i started to learn whats really happing behind the Screen.
Steps :
* We are calling Byte.toString() method
* then it calls Integer,toString() method
* in that it check for the radix and other stupid stuffs
* Finally it creates New String Object ()
* So every time the toString method will create a brand new Object
* So that only u r getting as False ..
BASE LINE : the base Line is when u create a String Object using new String() then u will have new Object with UNIQUE Memory Address. that it Boys ...