ExamVeda
Login
Home
This question belongs to Java Program Inheritence
Inheritence
?

What is the result of the following code snippet?

class Parent {
final void display() {
System.out.println("Parent");
}
}
class Child extends Parent {
void display() {
System.out.println("Child");
}
public static void main(String[] args) {
Child obj = new Child();
obj.display();
}
}

Answer & Solution
Correct Answer: Option D
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

1 Comment
Janardan Reddy
Janardan Reddy 10 months ago
i dint got the logic