Tips for heathy life

Tips for heathy life

Kamis, 30 Oktober 2008

Using Operator == in J2SE



I want to share how to Using Operator ==. You can use this code but if you copy this code and paste in your blog/website, please insert this link of article.

String str1="HelloJava";
String str2=new String(str1);
System.out.println("Kedua referensi sama : " + (str1==str2));
System.out.println("Kedua nilai objek String sama : " + (str1.equals(str2)));

0 komentar:

Posting Komentar