Bitwise operator in java
- how to use and operator in java
- how to use and operator in javascript
- how to use and operator in java in if statement
- how to use bitwise and operator in java
Types of operators in java with examples.
Java Logical Operators with Examples
Try it on GfG Practice
Logical operators are used to perform logical “AND”, “OR” and “NOT” operations, i.e.
the function similar to AND gate and OR gate in digital electronics.
Assignment operator in java
They are used to combine two or more conditions/constraints or to complement the evaluation of the original condition under particular consideration. One thing to keep in mind is, while using AND operator, the second condition is not evaluated if the first one is false.
Whereas while using OR operator, the second condition is not evaluated if the first one is true, i.e. the AND and OR operators have a short-circuiting effect. Used extensively to test for several conditions for making a decision.
- AND Operator ( && ) – if( a && b ) [if true execute else don’t]
- OR Operator ( || ) – if( a || b) [if one of them is true to execute else don’t]
- NOT Operator ( ! ) – !(a<b) [returns false if a is smaller than b]
Example For Logical Operator in Java
Here is an ex
- how to use ternary operator in java
- how to use ternary operator in javascript