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

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

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

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