Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Monday, November 19, 2007

java Arithmetic Operators

The result of arithmetic operators is double if either operand is double, else float if either operand is float, else long if either operand is long, else int.
++iAdd 1 to i before using the value in the current expression
--iAs above for subtraction
i++Add 1 to i after using the value in the current expression
i--As above for subtraction
n + mAddition. Eg 7+5 is 12, 3 + 0.14 is 3.14
n - mSubtraction
n * mMultiplication. Eg 3 * 6 is 18
n / mDivision. Eg 3.0 / 2 is 1.5 , 3 / 2 is 1
n % m Remainder (Mod) after division of n by m. Eg 7 % 3 is 1

No comments:

Post a Comment

Archives