Given:
5. class Shape { void doShape() { System.out.print("oo "); } } 6. class Rectangle extends Shape { 7. void doShape() { System.out.print("gui "); } 8. } // w w w . j ava 2 s . c om 9. public class Main extends Rectangle { 10. void doShape() { System.out.print("button "); } 11. public static void main(String[] args) { new Main().go(); } 12. void go() { 13. Rectangle g = new Rectangle(); 14. // this.doShape(); 15. // super.doShape(); 16. // g.super.doShape(); 17. // super.g.doShape(); 18. // super.super.doShape(); 19. } }
If the commented lines are uncommented independently, which are true? (Choose all that apply.)
A and B use the correct syntax.
C, D, and E are incorrect because none of them allow you to invoke OOThing
.doShape()
from the Main class.