![]() If a condition is true then Logical NOT operator will make false.įollowing are the assignment operators supported by Java language − Use to reverses the logical state of its operand. If any of the two operands are non-zero, then the condition becomes true.Ĭalled Logical NOT Operator. If both the operands are non-zero, then the condition becomes true.Ĭalled Logical OR Operator. ![]() The following table lists the logical operators −Īssume Boolean variables A holds true and variable B holds false, then −Ĭalled Logical AND operator. The left operands value is moved right by the number of bits specified by the right operand and shifted values are filled up with zeros. The left operands value is moved right by the number of bits specified by the right operand. There are following relational operators supported by Java language.Īssume variable A holds 10 and variable B holds 20, then −Ĭhecks if the values of two operands are equal or not, if yes then condition becomes true.Ĭhecks if the values of two operands are equal or not, if values are not equal then condition becomes true.Ĭhecks if the value of left operand is greater than the value of right operand, if yes then condition becomes true.Ĭhecks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true.īinary Right Shift Operator. Multiplies values on either side of the operator.ĭivides left-hand operand by right-hand operand.ĭivides left-hand operand by right-hand operand and returns remainder. Subtracts right-hand operand from left-hand operand. The following table lists the arithmetic operators −Īssume integer variable A holds 10 and variable B holds 20, then −Īdds values on either side of the operator. We can divide all the Java operators into the following groups −Īrithmetic operators are used in mathematical expressions in the same way that they are used in algebra. Java provides a rich set of operators to manipulate variables.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |