QUESTION 22자격증/OCJP_ExamD2018. 8. 4. 16:38
Table of Contents
반응형
QUESTION 22Given:abstract class A {abstract void a1();void a2(){ }}class B extends A {void a1() { }void a2() { }}class C extends B {void c1() { }}And:A x = new B();C y = new C();A z = new C();What are four valid examples of polymorphic method calls? (Choose four.)A. x.a2();B. z.a2();C. z.c1();D. z.a1();E. y.c1();F. x.a1();Solution : ABDF
plus imformation
C. z.c1(); // Won't compile. Method isn't defined in A
E. y.c1(); // Not polymorphic. Method is defined in declared class C.
반응형
'자격증 > OCJP_ExamD' 카테고리의 다른 글
QUESTION 24 (0) | 2018.08.04 |
---|---|
QUESTION 23 (0) | 2018.08.04 |
QUESTION 21 (0) | 2018.08.04 |
QUESTION 20 (0) | 2018.08.03 |
QUESTION 19 (0) | 2018.08.03 |
@IT grow. :: IT grow.
#IT #먹방 #전자기기 #일상
#개발 #일상