Yes, it's Java quiz time again.
"Everyone" knows you shouldn't compare strings by reference equality (==), but can you explain why...
public class Test1 { public static void main(String args[]) { System.out.println(("use" == "use") ? "True" : "False"); } }
...always prints 'True', and then...
public class Test2 { public static void main(String args[]) { System.out.println((new String("mention") == new String("mention")) ? "True" : "False"); } }
...always prints 'False'?