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


Please Help Members By Posting Answers For Below Questions

What is the purpose of encapsulation?

736


Why put method is idempotent?

644


What is style and indentation?

742


What is main string [] args?

725


What is advantage of java?

750


What class of exceptions are generated by the java run-time system?

865


What is return used for in java?

717


What is a singleton puppy?

723


how to handle exceptions in ejb?

2076


What is a byte array?

824


Why charat is used in java?

793


What is the public method modifier?

730


what is abstract class in Java?

869


What does this mean java?

768


What are filterstreams?

822