Question 1
What is the printout of the following code?
String s1 = "Welcome to Java";
String s2 = "Welcome to Java";
System.out.println("s1 == s2 is " + s1 == s2);
◦ true
◦ false
◦ s1 == s2 is true
◦ s1 == s2 is false
Question 2
What is the print out of the following code?
String s = "Welcome to Java";
s.replaceAll("a", "BB");
System.out.println(s);
◦ Welcome to JBBvBB
◦ Welcome to JBBva
◦ Welcome to Java
◦ Welcome to JavBB