QUESTION 44자격증/OCJP_ExamC2018. 7. 26. 06:26
Table of Contents
반응형
QUESTION 44Given:interface Fish { }class Perch implements Fish { }class Walleye extends Perch { }class Bluegill { }public class Fisherman {public static void main(String[] args) {Fish f = new Walleye();Walleye w = new Walleye();Bluegill b = new Bluegill();if (f instanceof Perch)System.out.print("f-p ");if (w instanceof Fish)System.out.print("w-f ");if (b instanceof Fish)System.out.print("b-f ");}}What is the result?A. w-fB. f-p w-fC. w-f b-fD. f-p w-f b-fE. Compilation fails.F. An exception is thrown at runtime.Solution : B
반응형
'자격증 > OCJP_ExamC' 카테고리의 다른 글
QUESTION 46 (0) | 2018.07.26 |
---|---|
QUESTION 45 (0) | 2018.07.26 |
QUESTION 43 (0) | 2018.07.26 |
QUESTION 42 (0) | 2018.07.26 |
QUESTION 41 (0) | 2018.07.26 |
@IT grow. :: IT grow.
#IT #먹방 #전자기기 #일상
#개발 #일상