User Tools

Site Tools


01_user_documentation:07_rgg_xl:02_xl:08_object:01_module:01_declaration:03_superclass_constr

Superclass constructor

It is also possible to declare the superclass constructor explicitly.

module C ( super.len ) extends B(len, "VAL") ; 
 
// is equivalent to:
class C extends B {
 
  C(float l) {
    super(l, "VAL"); 
  }
 
  ... // pattern
}

In this example the super constructor takes a value “VAL” as an argument, but the argument can be a method declared in the module. I.e.

module C ( super.len ) extends B(len, getName()) {
  String getName() {
    return "MyAmazingName";
  }
}
01_user_documentation/07_rgg_xl/02_xl/08_object/01_module/01_declaration/03_superclass_constr.txt · Last modified: 2025/09/04 16:54 by gaetan