Mathematical Operators

Mathematical operations are used everywhere whether to calculate a company's payroll or the employees' number. The structure of an operation is composed of operands and operators and usually The result is assigned to variables. the statement below is an example of an operation.

 int a = 1 + 2

  • 1 and 2 are the operands
  • The sign + is the Addition operator.
  • The sign = is the Assignment operator

Java supports other operators for different purposes :

  • Relational and equality operators
  • Logical operators 
  • Ternary operators
  • Unary operators
  • Binary operators

We'll see each one in the next sections .