Kizspy | Question: 25 (Choose 1 answer)
What is the output of the following Java program?
class Demo { void m1(String x) { System.out.println("One");}
}
class DemoChild extends Demo { public void m2(String x) { System.out.println("Two");super.m1(x);}
} public class Test {
public static void main(String[] args) { Demo obj = new DemoChild();obj.m2("PE");}
}
A. Compile error
B. Runtime error
C. Output is: Two One
D. Output is: One Two