The format of the class definition is:
"class" Class name
It is definition that start with the keyword class and end with the keyword endclass.
The class definition will generate a scope.
The keyword class is the start symbol for the class definition. Since it is a keyword, it cannot be used as an identifier.
It specifies the class name after "class". The naming rules for class name is the same as for identifiers.
Rice does not have a mechanism for avoiding class name collisions like namespaces in other languages.
For the class name, specify a unique name that does not conflict with other classes.
Member definition are:
The field declaration determines the state of the class, and the other member definitions determine the behavior.
There is no limit to the order and number of member definitions.
Details of individual member definitions will be explained on a separate page.
The keyword endclass is the end symbol for the class definition. Since it is a keyword, it cannot be used as an identifier.
You can use the abbreviation "ec" instead of "endclass". Note that "ec" is also a keyword.
As an example, definition of main class is reprinted. We've already mentioned that the main class is a special class, but it's definition is the same as any other user-defined class.
open method void start()
open method void end()
ec // Abbreviation
It has defined the class name "main", the start() method, and the end() method.