QUESTION 2자격증/OCJP_ExamC2018. 7. 19. 23:50
Table of Contents
반응형
QUESTION 2Given:1. interface A { public void aMethod(); }2. interface B { public void bMethod(); }3. interface C extends A,B { public void cMethod(); }4. class D implements B {5. public void bMethod(){}6. }7. class E extends D implements C {8. public void aMethod(){}9. public void bMethod(){}10. public void cMethod(){}11. }What is the result?A. Compilation fails because of an error in line 3.B. Compilation fails because of an error in line 7.C. Compilation fails because of an error in line 9.D. If you define D e = new E(), then e.bMethod() invokes the version of bMethod() defined in Line 5.E. If you define D e = (D)(new E()), then e.bMethod() invokes the version of bMethod() defined in Line 5.F. If you define D e = (D)(new E()), then e.bMethod() invokes the version of bMethod() defined in Line 9.Solution : F
반응형
'자격증 > OCJP_ExamC' 카테고리의 다른 글
QUESTION 6 (0) | 2018.07.21 |
---|---|
QUESTION 5 (0) | 2018.07.21 |
QUESTION 4 (0) | 2018.07.20 |
QUESTION 3 (0) | 2018.07.20 |
QUESTION 1 (0) | 2018.07.19 |
@IT grow. :: IT grow.
#IT #먹방 #전자기기 #일상
#개발 #일상