πŸ“Š JAVA
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
πŸ’¬ Discuss
βœ… Correct Answer: (C) class X

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
88
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Rakesh Kumar
Publisher
πŸ“ˆ
83%
Success Rate