Activity 01
Pair Programming: Vehicle Hierarchy
Pairs start with an abstract Vehicle class containing a concrete displayInfo() method and abstract startEngine() and stopEngine() methods. They implement subclasses like Car and Motorcycle, then test polymorphism in a main method by calling methods on a Vehicle array. Pairs swap code to extend with one new feature.
Differentiate between an abstract class and a concrete class in terms of instantiation and purpose.
Facilitation TipDuring the Pair Programming activity, circulate and ask each pair to explain why their abstract Vehicle class cannot be instantiated and how the concrete getFuelType() method supports the hierarchy.
What to look forProvide students with two class definitions: one abstract and one concrete. Ask them to write one sentence explaining why the abstract class cannot be instantiated and one sentence describing the purpose of its abstract methods.