What is the output of the following code?

```
public class Test {
public static void main(String[] args) {
String s1 = new String("Welcome to Java!");
String s2 = new String("Welcome to Java!");

if (s1 == s2)
System.out.println("s1 and s2 reference to the same String object");
else
System.out.println("s1 and s2 reference to different String objects");
}
}```
a. s1 and s2 reference to the same String object
b. s1 and s2 reference to different String objects


b

Computer Science & Information Technology

You might also like to view...

The FINDSTR command offers more control over the search process than the FIND command.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Which of the following is the maximum length a file name can be?

A. 64 characters B. 32 characters C. 255 characters D. 128 characters

Computer Science & Information Technology

Values and labels can be entered automatically using the fill handle and a technique called _____.

A. fill-and-drag B. drag-and-fill C. drag-and-drop D. drag-and-paste

Computer Science & Information Technology

The first window displayed when you install openSUSE is the ____ window.

A. Boot Options B. Configuration C. System Options D. Welcome

Computer Science & Information Technology