ptg7068951
264 HOUR 18:Handling Errors in a Program
Activities
To s e e w h e t h e r y o u a r e a n e x c e p t i o n a l J av a p r o g r a m m e r,try to make as few
errors as possible in the following activities:
. Modify the NumberDividerapplication so that it throws any exceptions
that it catches and run the program to see what happens.
. There’s a try-catchblock in the LottoEventclass you created in Hour
15,“Responding to User Input.” Use this block as a guide to create
your own Sleepclass,which handles InterruptedExceptionso other
classes such as LottoEventdon’t need to deal with them.
To s e e J av a p r o g r a m s t h a t i m p l e m e n t t h e s e a c t i v i t i e s ,visit the book’s website
at http://www.java24hours.com.