1.

What is the output of this program?

class N
{
int K;
void display()
{
System.out.println(K);
}
}
class M extends N
{
int L;
void display()
{
System.out.println(L);
}
}
public class inheritance_Example
{
public static void main(String args[])
{
M object = new M();
object.K=5;
object.L=6;
object.display();
}
}

A. 2
B. 3
C. 4
D. 5
E. 6
Answer» F.


Discussion

No Comment Found

Related MCQs