Definitely it has to be the comparison.
First you are using the String method equals() to compare both strings and
you get a boolean with the answer. This is the correct way to do it.
But to give your answer you are making a comparison (str == str1). This last
one is just checking if str and str1 are pointing to the same instance, this
is not the case as you have two instances of class String with the same
value.

Good luck,
Pablo.

2008/8/28 miga <[EMAIL PROTECTED]>

>
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to