OO Metaphors Home Page

Metaphor-Based Animations of OO Programs

This page contains six animations that use OO metaphors to visualize OO concepts. For each animation, the program code as well as an English and Finnish version of the animation are given. For presentation purposes, some of the animations restrict user input, e.g, so that only a small number of objects can be created even though the program code does not have such limitations. The programs use a simple console input class Input that can be found here.

We suggest that each animation is used with students as follows:

During animation:


The Animations

  • Basic OO Concepts: The first animation that introduces the concepts of class, object, member variable, constructor, method, static method main, parameter, return value, object reference, and the idea of garbage collection.

  • Revisiting Strings: A short example demonstrating that Strings are objects.

  • Arrays: Introduces arrays (containing integers), how to increase array size, local variables (both at method level and "for (int i=0;...")), and garbage collection.

  • Subclasses and inheritance: Simple subclasses, inheritance, overriding, super, polymorphism. Uses the Java ArrayList class.

  • Class variables: Class variable and class method in a program that would be more complex if implemented without these concepts.

  • Recursion: Abstract class having two subclasses with a method that is recursive in the other subclass and non-recursive in the other.


    Last updated: September 7, 2007

    saja.fi@gmail.com