S
Q. What is the result of the following code snippet?
class Parent {
protected void display() {
System.out.println("Parent");
}
}
class Child extends Parent {
void show() {
display();
}
}
public class Main {
public static void main(String[] args) {
Child obj = new Child();
obj.show();
}
}
- Correct Answer - Option(D)
- Views: 25
- Filed under category JAVA
Discusssion
Login to discuss.