Fields

Fields look like java field definitions including the initializer:

classs T {
    type field1 = init1;
    type field2; // initializer is optional
}

While Mantra is not statically typed, you still need to specify a
field type. You can also specify static and const to indicate class
variables:

class T {
    static int x = 3;
    const HEIGHT = 100;
}
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Dec 22, 2008

    Anonymous says:

    typo in first example classs instead of class

    typo in first example classs instead of class

Add Comment