1. Technology
Send to a Friend via Email

Arithmetic Operator



Arithmetic operators perform the same basic operations you would expect if you used them in mathematics (with the exception of the percentage sign). They take two operands and return the result of the mathematical calculation.

Java has five arithmetic operators:

 +    to add two numbers together or concatenate two Strings.
 -    to subtract one number from another.
 *    to multiply one number by another.
 /    to divide one number by another.
 %    to find the remainder from dividing one number by another.
 int seven = 3 + 4;
 int four = 9 - 5;
 int thirtySix = 6 * 6;
 int five = 10 / 2;
 int one = 5 % 2; 


# A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

  1. About.com
  2. Technology
  3. Java
  4. Java Glossary
  5. A
  6. Definition for the Term: Arithmetic Operator

©2014 About.com. All rights reserved.