Given the code below, which access modifiers (public, protected, or private) can legally be placed before the myMethod() method on line 3, if no other changes are made to the code? If line 3 is left as it is, which keywords can legally be placed before the myMethod method on line 8? 1. class HumptyDumpty 2. { 3. void myMethod() {} 4. } 5. 6. class HankyPanky extends HumptyDumpty 7. { 8. void myMethod() {} 9. }

  1. . private or nothing (default) on line 3. Nothing (default) or protected or public on line 8.

  2. public or protected on line 3. private or nothing (default) on line 8.

  3. Nothing (default) or protected or public on line 3. private or nothing (default) on line 8.

  4. public on line 3 and private on line8.


Correct Option: A

Find more quizzes: