Classes in Object-oriented programming

In-class discussion

Typescript syntax

The class keyword is used to create a new class in typescript. It'll look like this:

class Cat extends Animal {
    breed: string
    constructor(kingdom:string,phylum:string,class_:string,order:string,family:string,genus:string,species:string,breed:string) {
        super(kingdom,phylum,class_,order,family,genus,species);
        this.breed = breed;
    }

    meow():string {
       return "MRowl"
    }
}

Remember Kids Playing Chess On Freeways Get Squashed? (Kingdom, phylum, class, order, family, genus, species...)

Anyway, there are a few things in this class to notice.

Practice

Resources