Skip to content

Feb 22: ArrayList, Debugger

Learning Objectives

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

  • Summarize the differences between arrays and ArrayLists.
  • Describe how objects are stored in an ArrayList internally.
  • Write code that manipulates an ArrayList using for loops.

Reminders

Lesson Outline

Act08 [50 min]

Demo [10 min]

  • VS Code debugger

    • Setting breakpoints
    • Debugging unit tests
  • Keyboard shortcuts

    • F5 = Continue
    • F10 = Step Over
    • F11 = Step Into

Mini Lecture [15 min]

  • Checked vs Unchecked Exceptions
  • throws keyword and @throws tag
  • Two ways to handle an exception:
    • Use try-catch (in HW5 Board)
    • Declare throws (future homework)
    • Don't do both! (don't catch and throw)