Sail E0 Webinar
Question
What is the output for the below code ?interface A{ public void printValue();}1. public class Test{2. public static void main (String[] args){3. A a1 = new A(){4. public void printValue(){5. System.out.println("A");6. }7. };8. a1.printValue();9. }10. }
Options:
A .  Compilation fails due to an error on line 3
B .  null
C .  Compilation fails due to an error on line 8
D .  A
E .  None of these
Answer: Option D

Submit Your Solution Below and Earn Points !
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers