Skip to content
ExamplesOpen editor ↗

dira

→ new

Creates a new instance of a class.

dira Leina(diparamethara)

Use dira followed by a class name and arguments to create a fresh object based on that class. The class’s motlhophisi runs to set up the new instance.

Create an instance of a class
mofutakwalo Sediko {
  motlhophisi(r) {
    ye.r = r;
  }
}
diri s = dira Sediko(50);

mofutakwalo, motlhophisi