Java Arithemetic Operators
Arithmetic Operators Overview
In Java, or any programming language, really, we need a way to manipulate variables. While declaring them and never touching them again gives you some functionality, the real fun comes when you have dynamic variables.
Changing varibles in Java is very similar to how you change numbers in algebra. For example, to add two numbers in math, you might write “2 + 2”. As you would expect, this equals four. The same syntax is used when changing variables in Java. You could declare the sum of these two numbers as a varible. For example:
int sum = 2 + 2;
You aren’t limited to using numbers that you typed out, though. You can also use variables:
int num1 = 2;
int num2 = 3;
int sum = num1 + num2;
The ability for you to use variables opens up a ton of possibilities.
All Arithmetic Operators

To learn more about arithmetic operators, read about them in the Oracle Docs.