What are the unary operators in Java?


These are the operators which act on only one operand. There are three kinds of unary operators Assume integer variable A holds 10 –

OperatorDescriptionExample
- (Unary Minus)This operator is used to negate a given value.-10
++(Increment Operator)This operator is used to increment the value of a variable by 1.++10 gives 11
--(DecrementOperator)This operator is used to decrement the value of a variable by 1.--11 gives 10

Sai Subramanyam
Sai Subramanyam

Passionate, Curious and Enthusiastic.

Updated on: 20-Feb-2020

85 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements