Storing and Operating in Java
Storing and Operating in Java
Storing and Operating in Java
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.
● Arithmetic operators
● Assignment operators
● Comparison operators
● Logical operators
● Arithmetic Operators
● Arithmetic operators are used to perform common
mathematical operations.
= 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.