SETSWANA TRANSLATION: Skip to content

motlhophisi

SETSWANA TRANSLATION: The special method that initializes new class instances.

SETSWANA TRANSLATION: Define a motlhophisi inside a mofutakwalo block to set up the initial state of every new instance created with Ntsha.

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

mofutakwalo, Ntsha, ye