int i = 23;

String str = Integer.toString(i);//this is the method to convert any
INTEGER(only) to string


String str1= String.valueOf(i);//this is the method to convert any
value(INTEGER or FLOAT) to string

//in both cases no :23 is converted to string "23"  but stored in
different memory places.

System.out.println("Integer to String" + str);
System.out.println("String Value Of"+ str1);

Boolean  b1= str.equals(str1);//it will check only the characters
stored in both string(str,str1) so it will return true.

but Boolean  b1=(str==str1) will return false becos each has different
memory address.


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to