I got these from
http://www.angelfire.com/or/abhilash/quiz/quiz4.html 1. Read this piece of code carefully
if("String".replace('g','G') == "String".replace('g','G'))
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
Ans b
2. Read this piece of code carefully
if("String".replace('T','t') == "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
Ans a
3. Read this piece of code carefully
if("String".replace('t','t') == "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
Ans a
When it gives equal and when not? very much confused with this. Kindly help me.
Thanks
Geeta Vemula
