Home News DOC Class DL Others Cooker
Documents  >  Tutorial  >  definitionstatement
Definition statement

Purpose of this chapter.

We will learn about the definition statement.

Definition of the variable.

A definition statement determines a value at the same time When a variable is declared.

A definition statement is the following format.

class-name variable-name = expression ;

This is a statement that carry out the declaration and the initialization of the variable at the same time. The expression of the right-hand side of the assignment symbol must return an instance of the appropriate class.

Class name.

Class name represents the type of an instance that will be bound to the variable.

Variable name.

Variable name is an identifier that is used to access the variable.

Assignment symbol.

It is a symbol of order to set a value to a variable. The assignment symbol of the Rice is '='.


The expression generates an instance that is set in the variable. Type of the generated instance must be the same as the class-name.

The end of the definition statement.

The end of the definition statement is represented by a semicolon.

Copyright © Rice All rights reserved.