Introduction to OOP: Chapter 15 : Case Study: Container Classes [next] [previous] [audio] [real] [text]

Containers in Dynamic Languages

Containers in dynamic languages are relatively easy, since values just hold their own type (or can be cast into the appropriate type, as in Java).

Containers hold values of type Object.

Containers in Strongly Typed Languages are much more difficult.

Intro OOP, Chapter 15, Slide 4

(Although Java is strongly typed, containers in Java are similar, as they hold values of type Object. But values must then be cast back to their original type after they are removed from the container).