Chap10 EX Solutions

Chap10 EX Solutions - Java Software Solutions, 6th Edition...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Java Software Solutions, 6 th Edition Exercise Solutions, Ch. 10 Chapter 10 Exercise Solutions EX 10.1. Create a UML class diagram for the ProductCodes program. EX 10.2. What would happen if the try statement were removed from the level1 method of the ExceptionScope class in the Propagation program? If the try statement were removed from the level1 method, the ArithmeticException , when thrown, would propagate to the main method (which called the level1 method). Since there is no try statement in the main method, the program would terminate, producing the message associated with the exception. EX 10.3. What would happen if the try statement described in the previous exercise were moved to the level2 method? If the try statement were moved from the level1 method to the level2 method, the exception thrown in level3 would propogate only to level2, where it would be caught and handled. The level2 method would then be allowed to finish execution. EX 10.4. Look up the following exception classes in the online Java API documentation
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

Chap10 EX Solutions - Java Software Solutions, 6th Edition...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online