Home About Rice Downloads Documents Others Cooker CookerGX
Documents  >  Tutorial  >  assignmentstatement
Assignment statement

Purpose of this chapter.

We will learn about the assignment statement.

Setting of a value to the Lvalue.

An assignment statement sets an value that is returned by the right-side expression to the left-side expression (Lvalue).

An assignment statement is the following format.


Lvalue = expression ;


The right-side expression of the assignment symbol must return an instance of the appropriate class.


If the Lvalue ends with identifier or field name, the reference of the left-side will be changed to the address of an instance that is returned by the right-side expression.

If the Lvalue ends with a setter name, An assignment statement is converted to a setter call, the right-side expression will be an argument.

Lvalue.

The Lvalue is an expression that can be placed in the left-hand side of an assignment.

The Lvalue of the Rice is an expression that ends with a setter name, variable name, or field name.

Assignment symbol.

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

expression.

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

The end of the assignment statement.

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

The statement and the expression.

Please note that the assignment of the Rice is a statement. In other words, it does not return an instance of the result of the assignment.

It is not possible to connect the assignment because it does not return an instance of the result.

Next
Previous
Copyright © Rice All rights reserved.