Unary Operators


Unary Arithmetic Operators

The Java unary operators require only one operand. Unary operators are used to perform various operations i.e.:

incrementing/decrementing a value by one

++  Increment     Increases the value of a variable by 1

Ex.   ++x     

negating an expression

--  Decrement    Decreases the value of a variable by 1 

Ex. --x

inverting the value of a boolean