What will be the output of the following Java program?

class A

{

int i;

int j;

A()

{

i = 1;

j = 2;

}

}

class Output

{

public static void main(String args[ ])

{

A obj1 = new A();

A obj2 = new A();

System. out. print(obj1. equals(obj2));

}

}

1
false
2
true
3
1
4
Compilation Error

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation