Class Invariants
- Example: Queue with array list
elements only contains objects of type
Message
- Ch2/mail/MessageQueue.java
- It's true for constructor.
elements is initially empty
- Check mutators. Start with add
Parameter type is Message
- What's the use? Casts are correct!
return (Message)elements.remove(0);
previous |
start |
next .... [Slide 53] ....