All academies

Simulator

Inheritance Visualizer

Click a class in the hierarchy to see inherited properties, overridden methods, and the TypeScript that defines it.

GoldenRetriever owns

Properties cascade down the chain. Methods can be inherited or overridden. super() chains constructors upward.

  • Properties: name, breed, friendly
  • Methods: speak(), fetch(), swim()
GoldenRetriever.ts
class GoldenRetriever extends Dog {
  constructor(name: string) {
    super(name, "Golden Retriever");
  }
  friendly = true;
  swim() { return "splash"; }
}