Class: Full Hierarchy

A three-level inheritance tree with an abstract base class and typed members on every class — for member layout and deep hierarchies, not relationship markers.

class-full-hierarchy.mmd
classDiagram
  class Animal {
    <<abstract>>
    +String name
    +int age
    +eat() void
    +sleep() void
  }
  class Mammal {
    +bool warmBlooded
    +nurse() void
  }
  class Bird {
    +bool canFly
    +layEggs() void
  }
  class Dog {
    +String breed
    +bark() void
  }
  class Cat {
    +bool isIndoor
    +purr() void
  }
  class Parrot {
    +String vocabulary
    +speak() void
  }
  Animal <|-- Mammal
  Animal <|-- Bird
  Mammal <|-- Dog
  Mammal <|-- Cat
  Bird <|-- Parrot
Output
Class diagram, Zombie Mermaid <<abstract>> Animal + String name + int age + eat(): void + sleep(): void Mammal + bool warmBlooded + nurse(): void Bird + bool canFly + layEggs(): void Dog + String breed + bark(): void Cat + bool isIndoor + purr(): void Parrot + String vocabulary + speak(): void

More Class diagram examples