Vidyalelo
Java Programming · Q27

Interfaces and Abstract Classes

Programming · Java Programming · question 27

Q27

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
Answer
D.
MyClass

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board