Posts

Showing posts with the label Logical Operator in JAVA

Logical operator in JAVA

Image
 Logical operators are widely used in decision making in JAVA. The Operators are used to check the given condition or expression whether they are true or false. Mostly logical operators are used to check condition if there are two or more expression and whether the expressions(two or more expressions) are returning true or not. There are three logical operator i.e. AND Operator (&&), OR Operator (||) and NOT Operator (!). Lets see below example to explore it in more convenient way.  Let's suppose we are making console application based voting system. The criteria are defined below. 1)Must be citizen of some regulatory body, lets assume Nepal. At first he or she must have proof that he       or  she crossed 16 and has citizenship card. Then only the persoin is known as citizen.  1) Must have crossed age 18. (Age defined he or she is eligible for vote or not). 2) Must have Voting Card. If all the condition is satisfied then he or she is elig...