public static void main(String[] args) { boolean stmt1 = "champ" == "champ"; boolean stmt2 = new String("champ").equals(new String("champ")); boolean stmt3 = "champ".toString()=="champ"; System.out.println(stmt1 && stmt2 && stmt3); }
boolean stmt1 = "champ" == "champ";
boolean stmt2 = new String("champ").equals(new String("champ"));
boolean stmt3 = "champ".toString()=="champ";
System.out.println(stmt1 && stmt2 && stmt3);
}
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.