Storing and Operating in Java Class 7
Storing and Operating in Java Class 7
Variable
A variable is the name of a reserved area allocated in memory. In other words, it is a name of the
memory location. It is a combination of "vary + able" which means its value can be changed.
Java Operators
Arithmetic operators
Assignment operators
Comparison operators
Logical operators
Arithmetic Operators
Arithmetic operators are used to perform common
mathematical operations.
Operator Name Description Example
= x=5 x=5
+= x += 3 x=x+3
-= x -= 3 x=x-3
*= x *= 3 x=x*3
/= x /= 3 x=x/3
%= x %= 3 x=x%3
== Equal to x == y
!= Not equal x != y
You can also test for true or false values with logical
operators.