QUESTION 8자격증/OCJP_ExamC2018. 7. 21. 16:42
Table of Contents
반응형
QUESTION 8Given:01. public class Hello {02. String title;03. int value;04.05. public Hello() {06. title += " World";07. }08.09. public Hello(int value) {10. this.value = value;11. title = "Hello";12. Hello();13. }14. }and:Hello c = new Hello(5);System.out.println(c.title);What is the result?A. HelloB. Hello WorldC. Compilation fails.D. Hello World 5E. The code runs with no output.F. An exception is thrown at runtime.Solution : C
plus imformation
Main.java:12: cannot find symbol
symbol : method Hello()
location: class Hello
Hello();
^
1 error
반응형
'자격증 > OCJP_ExamC' 카테고리의 다른 글
QUESTION 10 (0) | 2018.07.21 |
---|---|
QUESTION 9 (0) | 2018.07.21 |
QUESTION 7 (0) | 2018.07.21 |
QUESTION 6 (0) | 2018.07.21 |
QUESTION 5 (0) | 2018.07.21 |
@IT grow. :: IT grow.
#IT #먹방 #전자기기 #일상
#개발 #일상