Comparison Logical and Bitwise Operator ( Java Part - 4 )
J ava Comparison Operators Comparison operators are used to compare two values: Operator Name Example Try it == Equal to x == y Try it » != Not equal x != y Try it » > Greater than x > y Try it » < Less than x < y Try it » >= Greater than or equal to x >= y Try it » <= Less than or equal to x <= y Try it » Java Logical Operators Logical operators are used to determine the logic between variables or values: Operator Name Description Example Try it && Logical and Returns true if both statements are true x < 5 && x < 10 Try it » || Logical or Returns true if one of the statements is true x < 5 || x < 4 Try it » ! Logical not Reverse the result, returns false if the result is true !(x < 5 && x < 10) Try it » Java Bitwise Operators Bitwise operators are used to perform binary logic with the bits of an integer or long integer. Operator Description Example Same as Result Decimal & AND -