Dashboard > Mantra > ... > Classes > Fields
  Mantra Log In | Sign Up   View a printable version of the current page.  
  Fields
Added by Terence Parr, last edited by Terence Parr on Nov 03, 2007
Labels: 
(None)

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;
}
Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.1 Build:#806 May 06, 2007) - Bug/feature request - Contact Administrators