运算所需变量为一个的运算符叫单目运算符 逻辑非运算符【!】、按位取反运算符【~】、自增自减运算符【++ --】、负号运算符【-】、类型转换运算符【(类型)】、指针运算符和取地址运算符【*和&】、长度运算符【sizeof】 运算所需变量为两个的运算符叫做双目运算符,例如+,-,*,/,%,<,>,>=,<=,==,!=,<<,>>,&,^,|,&&,||,= 运算所需变量为三个的运算符叫做三目运算符,只有条件表达式【?:】
表示单目运算符的UML操作还设置有返回类型和一个参数。
A return type and a single parameter are set for UML operation that represents a unary operator.
单目操作符(unary operator)是通过在关键字operator后跟单目运算符符号来命名的。
A unary operator is named by using the key word operator followed by the unary operator symbol.
表示双目运算符(binary operator)的UML操作的命名方式类似于单目运算符,但符号是双目运算符之一。
A UML operation representing a binary operator is named similarly to unary operator, but the symbol is one of the binary operators.
应用推荐