Examveda
Examveda

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));
     }
}

A. false

B. true

C. 1

D. Compilation Error

Answer: Option A


This Question Belongs to Java Program >> Inheritence

Join The Discussion

Related Questions on Inheritence

What is inheritance in Java?

A. The process of acquiring properties and behaviors of one class by another

B. The process of creating objects

C. The process of encapsulation

D. The process of overloading methods