Randomizer Project: Day 3

Polymorphism and Extending Classes


Videos

The Randomizer Project

This project will serve as a way to introduce students to the advanced Java concepts of Interfaces, Classes, Objects, Object Inheritance, Polymorphism, Extending Classes, and the use of Abstract Classes.

It will do this in the framework of creating a series of classes that can be used in any game context to introduce randomness into the game.

Therefore we will call all such classes Randomizers!

In day 3 of the series of video tutorials we will learn how Polymorphism is used to automatically call the correct method for the correct class when many different objects are stored in an array.

Next we will write one more Randomizer, a labeled die that can display any kind of text on any number of sides. First the class will be written from scratch, then we'll see how object oriented programming allows us reuse code by extending a class that already has some functionality we can use.

The code is organized into several files, but all the code is found in this PDF IconPDF.

You may download the completed code from day 2 as an Eclipse Project: .zip IconRandomizerProject_Day2_End.zip.

You may download the completed code from day 3 as an Eclipse Project: .zip IconRandomizerProject_Day3_End.zip.