OPERATORS of JAVA ;

TYPE OF OPERATORS ;

                     > Operators means, java are the special type of token in java which when coupled with entities.

                 > As a variables or constants or data types results in a specific operation.

             > Such as examples, addition, multiple, or even shifting of bits.

THE MAINLY FOLLOWING TYPE ;

> Arithmetic Operators


> Logical Operators


> Unary Operators


> Assignment Operators


> Ternary Operators


> Relational Operators


> Bitwise Operators

ARITHMETIC OPERATOR ;

                          > Arithmetic Operators are used to perform arithmetic operations. There are mainly 5 arthmetic opertor in java.

                        1. Additional

> A like as, Addition operator performs addition between two entities on either side of the operator.

                        2.subtraction

> A like as, Subtraction operator performs subtraction between two entities on either side of the operator.

                       3.multiplication

> A like as, Multiplication operator performs multiplication between two entities on either side of the operator.

                       4.Division

> A like as ,Division operator performs division and returns the quotient value of the division.

                       5.Modulo

> A like as , modulo opertor return the remainder after dividing the two operands .

SIMPLEX EXAMPLE ;


  public class ArithmeticOperator {
      public static void main(String[] args)  {
        int add,
        sub,
        mul,
        div,
        mod;
        int num1 = 5,
        num2 = 8;
        add = num1 + num2;
        sub = num1 – num2;
        mul = num1 * num2;
        div = num1 / num2;
        mod = num2 % num1;
    System.out.println(“Addition num1+num2 ” + add);
    System.out.println(“Subtraction num1-num2 ” + sub);
    System.out.println(“Multiplication num1*num2 ” + mul);
    System.out.println(“Division num1/num2 ” + div);
    System.out.println(“Modulus num2%num1 ” + mod);
  }
}

LOGICAL OPERATORS ;

        > jogical operators, like a perform in two type of Operators. They are primarily type of Operators.

                        > Logical AND in java

                        > Logical OR in java

LOGICAL AND IN JAVA ;

           > Logical AND checks whether the two conditions on either side of the expression is true.

           > If both the expressions are true then it returns false.

LOGICAL OR IN JAVA ;

            > checks whether either of the two conditions in the expression is true. If any one of the expressions is true, it evaluates to true.

             > However if none of the conditions are true then it returns false.

             > One thing to note is that if the first expression is already true it doesn’t check the second expression and returns true.

UNARY OPERATORS ;                 

                > Unary operators are those which have only one operand. They are of the following types  .that’s below ,

   >  Unary plus Operator
     >  Unary minus Operator
>  Increment Operator
>  Decrement Operator
>  Logical Not Operator,

UNARY PLUS OPERATORS ;

                     > A like , Unary plus operator converts byte short and character datatype values into integer values. 

                     > Characters when converted to integers return their ASCII value.

UNARY MINUS OPERATORS OR NEGATIVE OPERATORS ;

                > Simpl to Deliberately converts a positive value to a negative value.

INCREMENT OPERATORS ;

                 > A like as, increment operator is used for increasing the value of a particular value by one.

                > However there are a few concepts linked with the increment operator. There are two tyoesy.below ,

PRE- INCREMENT ;

Uni                > the value of the variable is first increased and then its used/ or its result is computed.           Exp-       (++a );

POST- INCREMENT ;

                > the value of the variable is first computed and then incremented. Exp- (a++)

DECREMENT OPERATOR ;

               > A like , decrement operator is just as opposite to the increment operator. It decreases the value of the variable by 1.

PRE-DECREMENT ;

                > the value of the variable is first decreased and then computed. Exp . –a

POST- DECREMENT ;

                > the value of the variable is first computed and then decremented by 1. Exp. a–

LOGICAL NOT OPERATOR ;

                 > Java logical Not operator flips the value of a boolean value. It is denoted by a !.

ASSIGNMENT OPERATORS ;

                 > Assignment operators are used to assign values to the variables on the left side of the equals sign.

              > The associativity is from right to left. Meaning that the values on the right are assigned to the values on the left.

             > The right hand side has to be a constant or a defined variable.

TYPE OF ASSIGNMENT ;

               > += This returns left=left+right
               >  -= This returns left=left-right
               >  *= This returns left=left*right
               >  /= This returns left=left/right
               >  %=This returns left=left%right

> As a examples of assignment operator.

RELATIONAL OPERATORS ;

               > Relational Operators are used to check the relation between values or variables.

               > The output of relational operators is always a boolean value.

              >  Relational operators are used by if conditions and for loop constraints.

SOME RELATIONAL OPERATORS ;

               #  < Less than – returns true if left entity lesser than right entity.

               #  >Greater than – returns true if left entity greater than right entity.

               #  <=Less than or equal to – returns true if the left entity is smaller than or equal to right.

                #  >=Greater than or equal to – returns true if left variable is greater than or equal to right entity.

                # ==(equals to) – returns true if the left and the right entities are equal.

                # !=(not equals to) – returns true if left and right entities are not equal.

BITWISE OPERATOR ;

             > Bitwise operators are generally used to perform operations on bits of data.

             > The individual bits of a number are considered in calculation and not the entire number itself.

TYPE OF BITWISE OPERATOR ;

            >AND &

            >OR |

             >XOR ^

            > COMPLEMENT ~

> those are important. There are using a more .after that , operators in minimum usages in our operator.

Leave a Comment