Exception Handling
© examsiri.com
Question : 16 of 24
Marks:
+1,
-0
Given:
What is the result?
1.classA {
2. public void process() { System.out.print(”A “); } }
3. class B extends A {
4. public void process() throws RuntimeException {
5. super.process();
6. if (true) throw new RuntimeException();
7. System.out.print(“B”); }}
8. public static void main(String[] args) {
9. try { ((A)new B()).process(); }
10. catch (Exception e) { System.out.print(”Exception “); }
11. }What is the result?
Go to Question: