자격증/OCJP_ExamB

QUESTION 45

IT grow. 2018. 7. 13. 19:14
반응형
QUESTION 45
Given:
static class A {
void process() throws Exception {
throw new Exception();
}
}
static class B extends A
{
void process()
{
System.out.println("B");
}
}
public static void main(String[] args) {
new B().process();
}
What is the result?
A. B
B. The code runs with no output.
C. Compilation fails because of an error in line 12.
D. Compilation fails because of an error in line 15.
E. Compilation fails because of an error in line 18.
Solution : A


반응형