MONDAY
Classes, constructors, and encapsulation
CAN-DO
I can design a class with private state, a validating constructor, and behavior methods, and explain why the state is not public.
USE THESE SOURCES
WHAT YOU DO
- Write the story and acceptance criteria before implementation: Replace parallel score arrays with Student and Quiz domain objects.
- Keep fields private and prevent invalid required state during construction.
- Place behavior on the relevant object instead of manipulating public fields.
- Test valid construction and one rejected value while keeping all Week 1 behavior green.
- Explain object identity, state, behavior, and one encapsulation tradeoff.
WHAT YOU KEEP
- Your story and criteria commit before implementation
- JUnit results for valid and rejected construction
- An explain-back on the design tradeoff
YOUR CHOICE
You choose class names, constructor shape, and which behavior belongs on Student or Quiz. Keep required state private, reject invalid construction, and preserve accepted Week 1 behavior.
CHECK BEFORE YOU MOVE ON
- The story and acceptance criteria are committed before the first domain implementation.
- A caller can use the required behavior without reading or changing a public field.