What is the output of the following code:
```
public class Test {
public static void main(String[] args) {
String s1 = new String("Java");
String s2 = new String("Java");
System.out.print((s1 == s2) + " " + (s1.equals(s2)));
}
}```
a. false false
b. true true
c. false true
d. true false
c s1 == s2 is false, since s1 and s2 are two different objects. s1.equals(s2) is true since the equals method returns true if two strings have the same content.
You might also like to view...
Which of the following types of network would be set up in an office so that customers could access the Internet but not be given access to internal resources such as printers and servers?
A. Quarantine network B. Core network C. Guest network D. Wireless network
File Explorer contains ribbon tabs that can be used for various functions. Which ribbon tab has buttons for manipulating files and folders?
A. File B. Home C. Share D. View