*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);

Can someone please tell me why b1 is false?

====================================================================

*

public* *class* StsticandInstanceMethods {

*public* *static* *void* main(String args[]){

String ins1=*new* String("I am an object instance of a String Class");

String ins2="Live your passion";

*char* x= ins1.charAt(2);

*char* y = ins1.charAt(1);

*char* z = ins1.charAt(0);

System.*out*.println(x);

System.*out*.println(y);

System.*out*.println(z);

*boolean* b = ins1.equalsIgnoreCase(ins2);

String ins3=b?"Yes":"No";

System.*out*.println(ins3);

*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);

//String str2=b?"Yes":"No";

*if* (str == str1) System.*out*.println("Yest");

*else* System.*out*.println("NO");

 }

}
===============
Output

a

I

No

Integer to String23

String Value Of23

NO

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