1.

What is the output of this program?

class N
{
public int K;
private int L;
}
class M extends N
{
void display()
{
super.K = super.L + 2;
System.out.println(super.K + " " + super.L);
}
}
public class inheritance_Example
{
public static void main(String args[])
{
M object = new M();
object.K=1;
object.L=2;
object.display();
}
}

A. 3 3
B. 4 4
C. Compilation Error
D. Runtime Error
E. None of these
Answer» D. Runtime Error


Discussion

No Comment Found

Related MCQs