Because high-school students are interested in driving, transportation is a great model for introducing class hierarchies and interfaces.

  • Start by making an abstract class called Vehicle or Transportation.
  • Next, have students make inheriting classes.
    • Students interested in car will make different types of sports-cars, students interested in travel will make pleas and trains, and students interested in sci-fi will make futurist vehicles.
  • Then students start to make their sub-level classes more and more specific.
  • Every class will need to address direction and speed, which opens the door for talking about overload methods.
    • This commonality makes it easier to talk to the whole class, even though they have created very different modes of transportation.
  • Following overload methods, present interfaces:
    • "Let’s put your this in an interface so it says you must have these methods (speed, direction, etc.) without specifically saying what the method will be."
  • Using models that maximize student engagement, in this case because they either just started driving or are about to begin driving, is a great way keep students interested and motivated.
    • Everyone knows about cars, planes, and trains so this is a topic they are interested in.
    • Additionally this topic is generic enough that they can take it in whatever direction their interest lies.

More about this tip

External Source

Interview with Joon Kim

Other Tips By