πŸ“Š JAVA
Q. 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();
}
}
  • (A) Parent
  • (B) Child
  • (C) Runtime exception
  • (D) Compilation error
πŸ’¬ Discuss
βœ… Correct Answer: (D) Compilation error

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
94
Total Visits
πŸ“½οΈ
12 mo ago
Published
πŸŽ–οΈ
Bhagwan Das
Publisher
πŸ“ˆ
84%
Success Rate