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 = s1.toUpperCase();
if (s1 == s2)
System.out.println("s1 and s2 reference to the same String object");
else if (s1.equals(s2))
System.out.println("s1 and s2 have the same contents");
else
System.out.println("s1 and s2 have different contents");
}
}
```
a. s1 and s2 reference to the same String object
b. s1 and s2 have the same contents
c. s1 and s2 have different contents
c. s1 and s2 have different contents
You might also like to view...
Worksheet titles and subtitles should be as wordy as possible.
Answer the following statement true (T) or false (F)
In a binary search tree, the node with the smallest value is the far-right leaf node in the tree.
Answer the following statement true (T) or false (F)
Explain how general controls impact transaction integrity and the financial reporting process.
What will be an ideal response?
Which of the following is used to prevent Layer 2 switching loops within a local area network?
A. STP B. MTU C. EGP D. IGP