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