Question 121)
Read this piece of code carefully
if("String".toString() == "String")
System.out.println("Equal");
else
System.out.println("Not Equal");
Answers
the code will compile an print "Equal".
the code will compile an print "Not Equal".
the code will cause a compiler error.
-----------------
the ans is the first one.why? Could anyone give me a clear idea?
esp.("String".toString() == "String")
Read this piece of code carefully
if("String".toString() == "String")
System.out.println("Equal");
else
System.out.println("Not Equal");
Answers
the code will compile an print "Equal".
the code will compile an print "Not Equal".
the code will cause a compiler error.
-----------------
the ans is the first one.why? Could anyone give me a clear idea?
esp.("String".toString() == "String")