main class


The main class has two features that is different from the other user-defined class.

1: Open methods of main class is possible to invoke from an application.

2: Instance other than the prototype is not generated.

Invoking the open methods

The open methods of the main class constitutes the interface of the Rice program.

Usually, start() method will be a entry point of a Rice program, however, other open methods are also possible to invoke from application.

How to use open methods of main class depends on an application.

An instance of main class

An instance of main class is always only one in a program.

Generating of other classes returns an address of a copy of prototype. However, generating of main class returns an address of prototype.

Preset constant

You can get the instance of the main class from preset constant "MAIN".

main m = MAIN;

Copyright © Rice All rights reserved.