1. Home
  2. Computing & Technology
  3. Java

Arithmetic Operator

By , About.com Guide

Definition:

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.
Examples:
int seven = 3 + 4;
int four = 9 - 5;
int thirtySix = 6 * 6;
int five = 10 / 2;
int one = 5 % 2;

Glossary:

# 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

Explore Java
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Java
  4. Java Glossary
  5. #
  6. Definition for the Term: Arithmetic Operator>

©2009 About.com, a part of The New York Times Company.

All rights reserved.