Question 8

· unclassifiedP · Verified PYQstrings

What is the output of the following code Class A{ public int i; public int j;

A(){ i=1; j=2; } } Class B extends A{ int a; B(){ super(); } } Class transform { public static void main(String,args[]){ B obj = new B(); System.out.println(obj.i+“”+obj.j); } }

  • A. 1 2
  • B. Compile-time error
  • C. Run time error
  • D. No Output

Answer: Option C

← Question 7Question 9 →
Report an issue with this question