Operators2


       Java Unary Operator

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

There are two types of  unary operators;


1. Increment

Adding 1 into the value.

2. Decrement

Subtracting 1 from the value.

Increment

There are two types of Increment
  1. Post Increment
  2. Pre Increment
1. Post Increment

Increment value after printing the value.
for example:

Output:



No comments:

Post a Comment