Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Suppose that the setRadius method throws the InvalidRadiusException defined in Listing 1 2 . 1 0 . What is displayed when running the following program?

Suppose that the setRadius method throws the InvalidRadiusException defined in Listing 12.10. What is displayed when running the following program? public class Test { public static void main(String[] args){ try { method(); System.out.println("After the method call"); } catch (RuntimeException ex){ System.out.println("RuntimeException in main"); }
catch (Exception ex){ System.out.println("Exception in main"); } } static void method() throws Exception { try { Circle c1= new Circle(1); c1.setRadius(1); System.out.println(c1.getRadius()); } catch (RuntimeException ex){ System.out.println("RuntimeException in method()"); } catch (Exception ex){ System.out.println("Exception in method()"); throw ex; } } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions