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 / manikandan [ gtec,vellore ]
Answer is 1)B because we directly calling a process method
in class B
Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
What is the purpose of encapsulation?
Why put method is idempotent?
What is style and indentation?
What is main string [] args?
What is advantage of java?
What class of exceptions are generated by the java run-time system?
What is return used for in java?
What is a singleton puppy?
how to handle exceptions in ejb?
What is a byte array?
Why charat is used in java?
What is the public method modifier?
what is abstract class in Java?
What does this mean java?
What are filterstreams?