πŸ“Š JAVA
Q. What is the result of the following code snippet?

class Parent {
static void display() {
System.out.println("Parent");
}
}
class Child extends Parent {
public static void main(String[] args) {
Child obj = new Child();
obj.display();
}
}
  • (A) Runtime exception
  • (B) Compilation error
  • (C) Child
  • (D) Parent
πŸ’¬ Discuss
βœ… Correct Answer: (D) Parent

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
85
Total Visits
πŸ“½οΈ
12 mo ago
Published
πŸŽ–οΈ
Vinay
Publisher
πŸ“ˆ
83%
Success Rate