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;
s1 += "and Welcome to HTML";
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
You might also like to view...
What is meant by a Hero image in a slideshow widget?
What will be an ideal response?
Variable names cannot contain ____.
A. numbers B. spaces C. underscore characters D. any of the above
A mathematical expression that contains functions, operators, constants, and properties, and returns a value to a cell
a. Caption b. Formula c. Field
Variables declared within a block of code can only be referenced within that block.
Answer the following statement true (T) or false (F)