What is the output of the following code?

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

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

a

Computer Science & Information Technology

You might also like to view...

CPU stands for ________

Fill in the blank(s) with correct word

Computer Science & Information Technology

When a date is entered into a cell, Excel assigns a(n) ________ or sequential number to it

Indicate whether the statement is true or false.

Computer Science & Information Technology