QUESTION 60자격증/OCJP_ExamC2018. 7. 26. 19:31
Table of Contents
반응형
QUESTION 60Given:1. public interface A { public void m1(); }2.3. class B implements A { }4. class C implements A { public void m1() { } }5. class D implements A { public void m1(int x) { } }6. abstract class E implements A { }7. abstract class F implements A { public void m1() { } }8. abstract class G implements A { public void m1(int x) { } }What is the result?A. Compilation succeeds.B. Exactly one class does NOT compile.C. Exactly two classes do NOT compile.D. Exactly four classes do NOT compile.E. Exactly three classes do NOT compile.Solution : C
plus imformation
Main.java:3:
B is not abstract and does not override abstract method m1() in A class B implements A { }
^
Main.java:5:
D is not abstract and does not override abstract method m1() in A class D implements A { public void m1(int x) { } }
^ 2 errors
class 에서 interface사용시 그대로 사용 .
abstract class 에서 interface 사용시 변경 사용 가능 (선언)
반응형
'자격증 > OCJP_ExamC' 카테고리의 다른 글
QUESTION 59 (0) | 2018.07.26 |
---|---|
QUESTION 58 (0) | 2018.07.26 |
QUESTION 57 (0) | 2018.07.26 |
QUESTION 56 (0) | 2018.07.26 |
QUESTION 55 (0) | 2018.07.26 |
@IT grow. :: IT grow.
#IT #먹방 #전자기기 #일상
#개발 #일상