JavaDeploy
SiteMap
Java Certification
Java Beans
Java-OO Concepts
Java Exceptions
«Prev
Next»
Java Basics
System Object Model
Interfaces Packages
Describe Java Package
Importing Packages
Access Control
Interface Role
Reclaiming Memory
Garbage Collection
Forcing GarbageCollection
Project Access Control
OOA Concepts
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
Intro Java Input/Output
Java Io Package
Java System.in Read Input
Data Input Stream
File Class To Access Files
Save Restore Draw Applet Project
Java Class Input Output Review
Java Stream Programming Conclusion
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