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
Explain the protected field modifier?
State some situations where exceptions may arise in java?
Can you instantiate the math class in Java?
I am unable to find or learn about print command. I have a graphical program in core java in applet but i want to give print command but i have coding for that so if anyone know about this plz mail me on avdhesh_chauhan007@yahoo.co.in
What is the difference between @before and @beforeclass annotation?
Difference between string s= new string (); and string s = "abv";?
What is the main use of java?
why are there separate wait and sleep methods? : Java thread
Say any two properties in beans?
why an outer class cannot be declared as private?
List down the methods and interfaces of collection class in java.
What is the maximum size of array in java?
What is anagram word?
What is a numeric digit?
Explain about assignment statement?