1.

What is the output of this program?
class N 
{
int p;
double q;
}
class M extends N
{
int r;
}
public class Output
{
public static void main(String args[])
{
N p = new N();
M q = new M();
Class object;
object = p.getClass();
System.out.print(object.getName());
}
}

A. p
B. q
C. N
D. M
E. r
Answer» D. M


Discussion

No Comment Found

Related MCQs