QUESTION 24자격증/OCJP_ExamB2018. 7. 10. 16:14
Table of Contents
반응형
QUESTION 24
Given:
1. public class A {
2. public void doit() {
3. }
4. public String doit() {
5. return "a";
6. }
7. public double doit(int x) {
8. return 1.0;
9. }
10. }
What is the result?
A. An exception is thrown at runtime.
B. Compilation fails because of an error in line 7.
C. Compilation fails because of an error in line 4.
D. Compilation succeeds and no runtime errors with class A occur.
Solution : C
plus imformation
Main.java:4:
doit() is already defined in A
public String doit() {
^ 1 error
반응형
'자격증 > OCJP_ExamB' 카테고리의 다른 글
QUESTION 26 (0) | 2018.07.10 |
---|---|
QUESTION 25 (0) | 2018.07.10 |
QUESTION 23 (0) | 2018.07.10 |
QUESTION 22 (0) | 2018.07.10 |
QUESTION 21 (0) | 2018.07.10 |
@IT grow. :: IT grow.
#IT #먹방 #전자기기 #일상
#개발 #일상