What will be the result of attempting to compile and run the following program?.
public class Main { public static void main(String[] args) { String s = "ab" + "12"; String t = "ab" + 12; String u = new String("ab12"); System.out.println((s==t) + " " + (s==u)); } }
Select the one correct answer.
(d)
The constant expressions "ab" + "12" and "ab" + 12 will, at compile time, be evaluated to the string-valued constant "ab12".
Both variables s and t are assigned a reference to the same interned String object containing "ab12".
The variable u is assigned a new String object, created by using the new operator.