TopBottom

Followers

Followers



Click on more
SUBSCRIBE



VIDEO

Announcement: wanna exchange links? contact me at ravikrak@yahoo.com

Operators in Java

Posted by Ravi Kumar at Thursday, March 5, 2009
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

The arithmetic operators +, –, *, / are used in Java for addition, subtraction, multiplication, and division. The / operator denotes integer division if both arguments are integers, and floating-point division otherwise.
Integer remainder (that is, the mod function) is denoted by %. For example, 17/2 is 8, 17%2 is 1, and 17.0/2 is 8.5.

Example:
int n = 5;
int a = 2 * n; // a is 10

In java x += 4; is equivalent to x = x + 4;

Share |

Labels:

0 comments:

Post a Comment