Skip to content

Feb 20: throw and try-catch

Learning Objectives

After today's class, you should be able to:

  • throw run-time exceptions with specific detail messages.
  • Use try and catch blocks to handle run-time exceptions.
  • Discuss when throwing and catching exceptions is useful.

Lesson Outline

HW4 Debrief [10 min]

  • Solution available in Canvas Files
  • Using null references in an array

Act07 [45 min]

Mini Lecture [20 min]

  • Example Diagram from last Thursday's class
  • Draw a memory diagram with Card objects

Your To-Do List

By Friday but ideally tomorrow

Before Thursday's class

  • Read the HW 5 spec
  • Download provided files

Memory Diagram

Here is the diagram I drew on the whiteboard:

Memory Diagram for Test.java