Abstract Classes

Hands-on practice for this lecture. Work through the exercises and quizzes to reinforce what you've learned.

1

Exercise 1 of 1

Incomplete Blueprints: Designing Abstract Classes

Balance code reuse and enforcement. Decide which methods in a "Shape" class should have logic and which should be left for children to implement.

calculateArea()
printInfo()
move(x, y)
draw()

Decide if each behavior in the Shape blueprint should be Abstract or Concrete.

🏗️ Abstract Classes allow you to provide partial functionality (Concrete) while enforcing rules for specialized behavior (Abstract).

Hands-on Labs

Practical exercises to master the concepts.

Practical Lab
Abstract Classes

Database Foundation

Create an abstract Database class with a concrete connect() method and an abstract query(sql: string) method.

Try implementing this on your own first!
Practice: Abstract Classes — Interactive Exercises | Durgesh Rai