Skip to content
Computer Science · Grade 11

Active learning ideas

Abstract Classes and Methods

Active learning helps students grasp abstract classes and methods because writing and testing code forces them to confront misconceptions in real time. Simply explaining these concepts leads to confusion about inheritance and implementation, but hands-on activities make the role of abstract classes as blueprints visible through immediate feedback and debugging.

Ontario Curriculum ExpectationsCS.HS.P.4CS.HS.D.1
25–45 minPairs → Whole Class4 activities

Activity 01

Problem-Based Learning35 min · Pairs

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.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 02

Problem-Based Learning45 min · Small Groups

Small Groups: Shape Calculator Challenge

Groups create an abstract Shape class with abstract calculateArea() and calculatePerimeter() methods, plus a concrete getColor() field. They develop three concrete shapes, such as Triangle, Square, and Circle, and build a program to compute totals for a list of shapes. Groups present one unique test case.

Analyze how abstract methods enforce a contract for subclasses.

Facilitation TipIn the Shape Calculator Challenge, provide starter code with deliberately missing implementations to guide students toward recognizing where abstract methods are required.

What to look forPresent a scenario: 'Imagine creating a system for different types of animals. Which would be better as an abstract class: 'Animal' or 'Dog', and why? What methods might be abstract in the chosen class?' Students write their answers on a mini-whiteboard.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 03

Problem-Based Learning25 min · Whole Class

Whole Class: Abstract vs Interface Debate

Display starter code for a Drawable interface and partial AbstractFigure class. Class discusses and votes on refactoring to abstract class for shared drawBorder() logic. Implement changes collectively on a shared screen, running tests to compare outcomes.

Design a scenario where an abstract class provides a more suitable solution than an interface.

Facilitation TipFor the Abstract vs Interface Debate, assign roles in advance and require each group to present one example where an abstract class was a better choice than an interface.

What to look forPose the question: 'When would you choose to use an abstract class over an interface in your code?' Facilitate a class discussion where students share examples and justify their reasoning, focusing on the benefits of shared concrete implementations and state.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 04

Problem-Based Learning30 min · Individual

Individual: Refactor Personal Project

Students select prior inheritance code and identify opportunities for abstraction, such as adding an abstract updateState() method to a base class. They implement, test, and document changes in a short reflection paragraph on improvements gained.

Differentiate between an abstract class and a concrete class in terms of instantiation and purpose.

Facilitation TipWhen students refactor their personal projects, remind them to first identify shared behaviors that belong in an abstract class before moving code between classes.

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.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

A few notes on teaching this unit

Teach this topic by starting with concrete examples students can relate to, then gradually abstracting shared behavior into a base class. Avoid jumping straight to theoretical definitions, as students need to experience the problem of duplicated code before they understand the value of abstract classes. Research shows that students retain concepts better when they debug their own misunderstandings rather than receive explanations upfront.

Students will demonstrate understanding by creating, extending, and testing abstract classes with both concrete and abstract methods. They will explain why abstract classes cannot be instantiated and justify design choices between abstract classes and interfaces when building hierarchies.


Watch Out for These Misconceptions

  • During Pair Programming: Vehicle Hierarchy, watch for students attempting to create instances of the abstract Vehicle class or leaving abstract methods unimplemented.

    After the Pair Programming activity, ask each pair to intentionally try instantiating their abstract class and observe the compiler error, then discuss why the error enforces subclass completion.

  • During Small Groups: Shape Calculator Challenge, watch for students assuming all methods in an abstract class must be abstract.

    In the Shape Calculator Challenge, provide a starter Shape class with a concrete calculateArea() method and an abstract draw() method, then have students test and explain how the concrete method reduces duplication.

  • During Whole Class: Abstract vs Interface Debate, watch for students treating abstract classes and interfaces as interchangeable tools.

    In the debate, require each group to present a scenario where shared implementation justifies an abstract class, contrasting it with a pure interface example they must defend.


Methods used in this brief