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 is finally in Java?
What is double checked locking in singleton?
What are recursive functions? Give some examples?
Why hashmap is used in java?
Is java a digit method?
What is difference between array and arraylist in java?
What is instance example?
23. Storage space in java is of the form Stack Queue Heap List 24. What is java code embedded in a web page known as Applets Servlets scriptlets snippets 25. Which of the following attributes are compulsory with an
What is difference between add() and addelement() in vector?
Is string a class in java?
Explain the difference between throw and throws in java?
Why do we use return statement?
Difference between string, stringbuffer and stringbuilder?
How to sort a collection of custom Objects in Java?
What is matcher in java?