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¶
- By Friday 11pm: Do the Week 6 reading and take Quiz05
- By Monday 11pm: Complete Homework 5 (due Feb 26)
Lesson Outline¶
Act08 [50 min]
- Activity 8: ArrayList Objects
- Memory diagrams of ArrayLists
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 HW5Board
) - Declare
throws
(future homework) - Don't do both! (don't catch and throw)
- Use