Aliensbrain
  • Home
  • Topics
  • Quizzes
  • Notebooks
  • Community
  • Sign in
  • programming languages Online Quiz - 16
  • What is the result of the following code? 1. public abs...

What is the result of the following code? 1. public abstract class A { 2. private void doStuff() { 3. System.out.println("A"); 4. } 5. 6. public static void main(String [] args) { 7. A a = new B(); 8. a.doStuff(); 9. } 10. } 11. 12. class B extends A { 13. protected void doStuff() { 14. System.out.println("B"); 15. } 16. }

technology programming languages
  1. A

  2. B

  3. Compiler error on line 7

  4. Compiler error on line 13


Show answer
Correct Option: A

Find more quizzes:

© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy