V

Vikash Gupta • 33.56K Points
Instructor I

Q. What will be the output of the following Java program?
class X
{
int a;
double b;
}
class Y extends X
{
int c;
}
class Output
{
public static void main(String args[])
{
X a = new X();
Y b = new Y();
Class obj;
obj = b.getClass();
System.out.print(obj.getSuperclass());
}
}

  • (A) X
  • (B) Y
  • (C) class X
  • (D) class Y
  • Correct Answer - Option(C)
  • Views: 60
  • Filed under category JAVA

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics