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

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

1 Expert Approved Answer
Step: 1 Unlock

d The constant expressions ab 12 and ab 12 will at compile ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming 8th Questions!