Skip to content
ExamplesOpen editor ↗

motlhophisi

→ constructor

The special method that initializes new class instances.

motlhophisi(diparamethara) { ... }

Define a motlhophisi inside a mofutakwalo block to set up the initial state of every new instance created with dira.

A class with a constructor
mofutakwalo Sediko {
  motlhophisi(r) {
    ye.r = r;
  }
}

mofutakwalo, dira, ye