Home News DOC Class DL Others Cooker
Documents  >  Tutorial  >  operators

Purpose of this chapter.

We will learn about the operators which is the elements that make up the expression.

Operation to instances.

An operator is a symbol that specifies the operation to be performed on an instance. The operator performs an operation on the operand and returns an instance of the result.

Operators have precedence. Expressions that contain multiple operators are computed from operators with higher priorities.

The following is a list of operators. The smaller the group number is the higher the priority. Operators of the same group have the same priority. If operators with the same priority are adjacent, the operation is executed in order from the left of the expression.

First group
()x(y)method call operator
newnew int()new operator
thisthisthis operator
Second group
.x.ydot operator
++xunary + operator
--xunary - operator
!!xlogical negation operator
Third group
*x * ymultiplication operator
/x / ydivision operator
%x % yremainder operator
4th group
+x + yaddition operator
-x - ysubtraction operator
5th group
<x < yless than operator
<=x <= yless than or equal operator
>x > ygreater than operator
>=x >= ygreater than equal operator
6th group
==x == yvalue equality operator
!=x != yvalue inequality operator
$$x $$ yreference equality operator
!$x !$ yreference inequality operator
7th group
&x & ylogical AND operator
8th group
|x | ylogical OR operator

Let's explain the operators of each group in the following chapter.

Copyright © Rice All rights reserved.