Home Java JDK 8 Features Spring Boot React JS Servlet Data JPA JDBC Microservices Hibernate

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