D LanguageClasses


Syntax

  • class Foo { } // inherits from Object
  • class Bar: Foo { } // Bar is a Foo too
  • Foo f = new Foo(); // instantiate new objects on the heap

Remarks

See the specification, browse a book chapter on classes, inheritance and play interactively.