print
Advertisment
Advertisment

Operators

Operators in Java are symbols that used perform many oprations on one and more oprands. For ex +, - and conditions operations etc.

Operators in Java are divided into three categories.

  1. Unary Operator
  2. Binary Operator and
  3. Ternary Operator

Unar operators

unary operators are those operators where we use only one operand to perform the operation. in the unary there are two operators available, increment operator and decrement operator

Example

	
	
1. ++
2. --
	

Advertisment

Binary operators

binary operator are those operators where we use two operands to perform operation. We have many types of operators available in Binary Operators which we will cover in the coming lectures.

Example

	
	
1. arithmetic operators
2. concatenation operators
3. Relational operators
4. Short circuit operators. etc...
	

Advertisment

Ternary operators

Ternary operators are those in which we need 3 operands to perform any operation, in Java we have only conditional operator as a ternary operator

Example

	
	
(condition) ? true : false 
	
Advertisment
Advertisment
arrow_upward