instanceof Operator

instanceof Operator :

Here's an example of instance of operator.
class instanceofOperator {
    public static void main(String[] args) {
     
     String test = "asdf";
     boolean result;
     
     result = test instanceof String;
     System.out.println(result);
    }
}

Unary Operators

Unary operator performs operation on only one operand.


OperatorMeaning
+Unary plus (not necessary to use since numbers are positive without using it)
-Unary minus; inverts the sign of an expression
++Increment operator; increments value by 1
--decrement operator; decrements value by 1
!Logical complement operator; inverts the value of a boolean

Counters