Question: What will be the result of attempting to compile and run the following program? Select the one correct answer. (a) The program will fail to
What will be the result of attempting to compile and run the following program?
![public class RefEq { public static void main(String [] args) { String](https://dsd5zvtm8ll6.cloudfront.net/images/question_images/1706/9/4/8/95265bdf958dbfb91706948952220.jpg)
Select the one correct answer.
(a) The program will fail to compile.
(b) The program will print false false at runtime.
(c) The program will print false true at runtime.
(d) The program will print true false at runtime.
(e) The program will print true true at runtime.
public class RefEq { 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));
Step by Step Solution
3.49 Rating (159 Votes )
There are 3 Steps involved in it
d The constant expressions ab 12 and ab 12 will at compile ... View full answer
Get step-by-step solutions from verified subject matter experts
