QUESTION 51자격증/OCJP_ExamC2018. 7. 26. 07:43
Table of Contents
반응형
QUESTION 51Given:12. String csv = "Sue,5,true,3";13. Scanner scanner = new Scanner( csv );14. scanner.useDelimiter(",");15. int age = scanner.nextInt();What is the result?A. Compilation fails.B. After line 15, the value of age is 5.C. After line 15, the value of age is 3.D. An exception is thrown at runtime.Answer: D Section: AllExplanation/Reference: Exception in thread "main" java.util.InputMismatchExceptionat java.util.Scanner.throwFor(Scanner.java:840)at java.util.Scanner.next(Scanner.java:1461)at java.util.Scanner.nextInt(Scanner.java:2091)at java.util.Scanner.nextInt(Scanner.java:2050)at main(Main.java:15)Solution : D
반응형
'자격증 > OCJP_ExamC' 카테고리의 다른 글
QUESTION 53 (0) | 2018.07.26 |
---|---|
QUESTION 52 (0) | 2018.07.26 |
QUESTION 50 (0) | 2018.07.26 |
QUESTION 49 (0) | 2018.07.26 |
QUESTION 48 (0) | 2018.07.26 |
@IT grow. :: IT grow.
#IT #먹방 #전자기기 #일상
#개발 #일상