11. static class A {
12. void process() throws Exception { throw new Exception();
}
13. }
14. static class B extends A {
15. void process() { System.out.println(”B”); }
16. }
17. public static void main(String[] args) {
18. new B().process();
19. }
What is the result?
1 B
2 The code runs with no output.
3 Compilation fails because of an error in
line 12.
4 Compilation fails because of an error in
line 15.
Answer Posted / neil
B
| Is This Answer Correct ? | 15 Yes | 4 No |
Post New Answer View All Answers
What are JVM.JRE, J2EE, JNI?
Differentiate between overriding and overloading cases?
what is the use of pojo (plain old java objects)? how it is interact with crystal reports? pls urgent
What are benefits of java?
What is keyword and identifier?
What does math floor () do?
What are the important features of Java 11 release?
Difference between error and exception
What is better - 'bit-shift a value' or 'multiply by 2'?
Explain about narrowing conversion in java?
Difference between abstract and concrete class ?
How do you remove duplicates in java?
What is used of static keyword in java?
State differences between C and Java?
Can list be final in java?