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
How do you sort arrays in java?
What does it mean that a class or member is final?
Why Do I Get A "permission Denied" Error After Downloading The .jnlp Java Launcher For The Vkvm?
What is the use of a copy constructor?
os is developed in c no java is more secured then c na why dont the os developed is developed using java
What is the difference between static (class) method and instance method?
What is collection api?
How do you sort an array in java?
What is the difference between compile-time polymorphism and runtime polymorphism?
Can a static method be overridden in java?
Define canvas?
How do you calculate roots in java?
Explain java heap space and garbage collection?
What do you understand by the term wrapper classes?
What does jre stand for?