Skip to content

Latest commit

 

History

History
86 lines (79 loc) · 2.7 KB

overridden-method.md

File metadata and controls

86 lines (79 loc) · 2.7 KB

Overridden Method

An overridden method is a method that is implemented:

  • in your class, and
  • in one of your base classes too

For example:

class MediaType implements Value<string> {
    // ... other properties left out

    public valueOf(): string {
        return this.value;
    }
}

class ContentType extends MediaType {
    // `valueOf()` is an overridden method
    //
    // it was originally implemented
    // in our base class `MediaType`
    public valueOf(): string {
        return this.parse().contentType;
    }
}