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


Please Help Members By Posting Answers For Below Questions

How do you sort arrays in java?

517


What does it mean that a class or member is final?

551


Why Do I Get A "permission Denied" Error After Downloading The .jnlp Java Launcher For The Vkvm?

618


What is the use of a copy constructor?

568


os is developed in c no java is more secured then c na why dont the os developed is developed using java

3516






What is the difference between static (class) method and instance method?

566


What is collection api?

602


How do you sort an array in java?

531


What is the difference between compile-time polymorphism and runtime polymorphism?

557


Can a static method be overridden in java?

554


Define canvas?

560


How do you calculate roots in java?

519


Explain java heap space and garbage collection?

576


What do you understand by the term wrapper classes?

536


What does jre stand for?

598