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
Difference between serialization and deserialization in java?
Define array. Tell me about 2-D array.
What is queue in java?
What is string in java with example?
What do you understand by access specifiers in Java?
Can you call a method in a method?
What are passing parameters?
What are the 3 types of loops in java?
Write a factorial program using recursion in java?
what is daemon thread and which method is used to create the daemon thread? : Java thread
Is it possible to define a method in java class but provide it’s implementation in the code of another language like c?
What is finalize method?
How are destructors defined in java?
What is the most important feature of java? What is an interface?
Explain the difference between serializable and externalizable in java?