What is the output of the following code:

```
public class Test {
public static void main(String[] args) {
Object o1 = new Object();
Object o2 = new Object();
System.out.print((o1 == o2) + " " + (o1.equals(o2)));
}
}```
a. false false
b. true true
c. false true
d. true false


a o1 == o2 is false, since o1 and o2 are two different objects. o1.equals(o2) is false since the equals method returns o1 == o2 in the Object class.

Computer Science & Information Technology

You might also like to view...

A virus attack is also known as a ________

A) logic bomb B) moneyload C) time bomb D) payload

Computer Science & Information Technology

A document that uses text, pictures, and drawings to convey its message is called a(n) ____________________.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Battery life is the time your device operates before it must be recharged.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Plan to buy a computer that will last you for ____ year(s).

A. one B. two to three C. three to five D. five to ten

Computer Science & Information Technology