1 / 5
文档名称:

Operators and Assignments(1)(1).txt

格式:txt   页数:5
下载后只包含 1 个 TXT 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

Operators and Assignments(1)(1).txt

上传人:管理资源吧 2011/9/11 文件大小:0 KB

下载得到文件列表

Operators and Assignments(1)(1).txt

文档介绍

文档介绍:×÷Õߣºjeru
email: jeru@
ÈÕÆÚ£º7/3/2001 9:55:32 AM
5)Operators and Assignments
Objective 1)
Determine the result of applying any operator including assignment operators and instanceof to operands of any type class scope or accessibility or bination of these.
Unary operators.
Increment and Decrement operators ++ --
We have postfix and prefix notation. In post-fix notation value of the variable/expression is modified after the value is taken for the execution of statement. In prefix notation, value of the variable/expression is modified before the value is taken for the execution of statement.
x = 5; y = 0; y = x++; Result will be x = 6, y = 5
x = 5; y = 0; y = ++x; Result will be x = 6, y = 6
Implicit narrowing conversion is done, when applied to byte, short or char.
Unary minus and unary plus + -
+ has no effect than to stress positivity.
negates an expression¡¯s value. (2¡¯plement for integral expressions)
Negation !
Inverts the value of a boolean expression.
~
Inverts the bit pattern of an integral expression. (1¡¯plement ¨C 0s to 1s and 1s to 0s)
(~i=-i-1)
Cannot be applied to non-integral types.
Cast ()
piler to allow certain assignments. Extensive checking is done pile and runtime to ensure type-safety.
2. Arithmetic operators - *, /, %, +, -
¡¤ Can be applied to all numeric types.
¡¤ Can be applied to only the numeric types, excep