JavaDeploy
SiteMap
Java Certification
Java Beans
Java-OO Concepts
Java Exceptions
«Prev
Next»
Java Basics
System Object Model
Access Inheritance
Access Package
Extending Classes
Package Organization
Interface Role
Java Exceptions
Exceptions - Quiz
Catching Exceptions-Quiz
Finally-Keyword -Quiz
Throwing Exceptions - Quiz.
Catching Exceptions Baseball
Common Java Exceptions
Java Multitasking
Using Join for Threads
Starting JavaThread - Quiz
Coordinating Java Threads - Quiz
Thread States -Quiz
Java Input Output
Java IO Package
Data InputStream
JavaClass InputOutput Review
Java IO Quiz
Java Exception handling - Exercise
Modify Java drawing program
Objective:
Add the following elements to the drawing program you copied from the previous lesson:
Create a new type of Exception, called a ShapeException.
In makeShape(), if the shape type was not found, throw a ShapeException.
(Hint: do you need to change the method declaration?)
Handle the exception by simply returning from mousePressed().
When this runs without an uncaught exception, paste your solution into the text area below:
Submit