The format of the class definition is:
"class" Class name
It is definition that start with the class keyword and end with the endclass keyword.
The class definition will generate a scope.
The class keyword 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.
The endclass keyword 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, we reprint the definition of main class. We've already mentioned that the main class is a special class, but it's definition is the same as other user-defined classes.
open method void start()
open method void end()
ec // Abbreviation
It has defined the class name "main", the start() method, and the end() method.