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. false false
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...

The Photo Album feature of PowerPoint is an efficient way to insert a large number of photographs into a slide show just by selecting the photographs you want to include in the presentation

Indicate whether the statement is true or false

Computer Science & Information Technology

How many subnets and hosts are provided by the network 192.168.254.0/26?

A) 4 networks with 64 hosts B) 4 networks with 62 hosts C) 254 networks with 62 hosts D) 2 network with 62 hosts

Computer Science & Information Technology