Hi,
Did you actually test the value of b1 after Boolean b1= str.equals(str1); ?
I think you are seeing the result of
if(str == str1)
System.out.println("Yest");
else
System.out.println("NO");
And this is a totally different thing. To see why follow miga's advice (read
the javadoc for class String).
Jose Luis
"Any sufficiently advanced technology is indistinguishable from magic"
-- Arthur C Clarke
----- Original Message ----
From: miga <[EMAIL PROTECTED]>
To: Free Java Programming Online Training Course By Sang Shin
<[email protected]>
Sent: Thursday, August 28, 2008 2:09:35 PM
Subject: [java programming] Re: Difference between Integer.toString()
String.valueOf()
Could you make a favor to the forum:
1 - not to post a whole program, but just the snippet related to your
question, that is:
> *int* i = 23;>
> String str = Integer.*toString*(i);>
> String str1= String.*valueOf*(i);>
> System.*out*.println("Integer to String" + str);>
> System.*out*.println("String Value Of"+ str1);>
> Boolean *b1*= str.equals(str1);
>
2 - Make an effort to read the javadoc for class String and the
lesson, where your question is answered.
Otherwise this course and any other one will not be of much use for
you.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---