Activities

To see whether you are an exceptional Java programmer, try to make as few errors as possible in the following activities:

  • Modify the DivideNumbers app so that it throws any exceptions that it catches, and run the program to see what happens.
  • There's a try-catch block in the LottoEvent class you created in Hour 15, "Responding to User Input." Use this block as a guide to create your own Sleep class, which handles InterruptedException so other classes like LottoEvent don't need to deal with them.

To see Java programs that implement these activities, visit the tutorial's website at http://www.java24hours.com.

      
Comments