July 2011
Intermediate to advanced
400 pages
8h 46m
English

We ended the previous chapter by creating two new classes: a Thing and a Treasure. Despite the fact that these two classes shared some features (notably both had a “name”), there was no connection between them.
These two classes are so trivial that this tiny bit of repetition doesn’t really matter much. However, when you start writing real programs of some complexity, your classes will frequently contain numerous variables and methods, and you really don’t want to keep coding the same things over and over again.
It makes sense to create a class hierarchy in which one class may be a “special ...
Read now
Unlock full access