0PricingLogin
Dart Academy · Lesson

extends and Method Overriding

Share and specialize parent behavior.

Sharing Behavior

When two classes share most of their behavior, you can write it once and reuse it. Dart calls this inheritance, and it saves you from copy-paste. 🌱

The extends Keyword

You inherit by writing extends after a class name. The new class is a child that automatically gains the parent's fields and methods.

class Animal {}
class Dog extends Animal {}

All lessons in this course

  1. extends and Method Overriding
  2. Calling super and Constructor Chaining
  3. Mixins With the with Keyword
  4. on Constraints and Mixin Order
← Back to Dart Academy