QUESTION 5자격증/OCJP_ExamD2018. 7. 29. 15:51
Table of Contents
반응형
QUESTION 5Click the Exhibit button.1. public class GoTest {2. public static void main(String[] args) {3. Sente a = new Sente(); a.go();4. Goban b = new Goban(); b.go();5. Stone c = new Stone(); c.go();6. }7. }8.9. class Sente implements Go {10. public void go(){11. System.out.println("go in Sente");12. }13. }14.15. class Goban extends Sente {16. public void go(){17. System.out.println("go in Goban");18. }19.20. }21. class Stone extends Goban implements Go{22. }23.24. interface Go { public void go(); }What is the result?A. go in Goban go in Sente go in SenteB. go in Sente go in Sente go in GobanC. go in Sente go in Goban go in GobanD. go in Goban go in Goban go in SenteE. Compilation fails because of an error in line 17.Solution : C
plus imformation
Sente () : go in Sente
Goban () : go in Goban
Stone () : go in Goban 상속받아서 출력
반응형
'자격증 > OCJP_ExamD' 카테고리의 다른 글
QUESTION 7 (0) | 2018.07.29 |
---|---|
QUESTION 6 (0) | 2018.07.29 |
QUESTION 4 (0) | 2018.07.26 |
QUESTION 3 (0) | 2018.07.26 |
QUESTION 2 (0) | 2018.07.26 |
@IT grow. :: IT grow.
#IT #먹방 #전자기기 #일상
#개발 #일상