Java provides seven unary operators:
The increment and decrement operators: ++ and --
The unary plus and minus operators: + and -
The bitwise inversion operator: ~
The boolean complement operator: !
The cast: ()
publicclass MainClass{
publicstaticvoid main(){
//The ++ and -- operators modify the value of an expression by adding or subtracting 1.
double d=0.12345D;
d++;
System.out.println(d);
}
}