public class Tester { public static void main(String[] args) { StringBuffer sb1 = new StringBuffer("javachamp"); StringBuffer sb2 = new StringBuffer("javachamp"); boolean stmt1 =sb1.equals(sb2) ; boolean stmt2 = sb1 == sb2; String s1 = new String("javachamp"); String s2 = new String("javachamp"); boolean stmt3 = s1.equals(s2); boolean stmt4 = s1 == s2; } }
public static void main(String[] args) {
StringBuffer sb1 = new StringBuffer("javachamp");
StringBuffer sb2 = new StringBuffer("javachamp");
boolean stmt1 =sb1.equals(sb2) ;
boolean stmt2 = sb1 == sb2;
String s1 = new String("javachamp");
String s2 = new String("javachamp");
boolean stmt3 = s1.equals(s2);
boolean stmt4 = s1 == s2;
}
Oracle Certified Professional Java Programmer
Access: Public Instant Grading
Jobilize.com uses cookies to ensure that you get the best experience. By continuing to use Jobilize.com web-site, you agree to the Terms of Use.