What is the difference between the Boolean & operator and the && operator?

What is the difference between the Boolean & operator and the && operator?

Hello,

What is the difference between the Boolean & operator and the && operator?

thanks,

View Answers

April 18, 2013 at 4:46 PM

hi friend,

boolean '&' operator is used for two operands or expressions it gives the result true only when both side operands or expressions are true otherwise, it returns false if any side of operand or expression is false it returns false. In this case both sides operands or expressions evaluated.

However, '&&' operator is used for two operands or expressions and gives the result true if both side operands or expressions are true. But, in this case only the left side operands are evaluated and the right side operands will not be evaluated if the left hand side operand is false and will leave that statement and read the next statement (if any).

For example and more detail please visit the link below may, this will be helpful for you.

http://www.roseindia.net/java/master-java/conditional-operators.shtml









Related Tutorials/Questions & Answers:
Java 'or' operator
difference between == and === operators?
Advertisements
PHP String Operator
Operator Precedence
Java bitwise OR "|" operator
The Unary Operators
Java Left Shift "<<" Operator
Java "&" operator
Java Right Shift ">>" Operator
PHP Array Operator
Java Operators
Unary Operators
Using Operators in JSP
Conditional (Logical) Operators
precedence operators c++ example
Java Operators List
Java Operators List
Java Operators List
Java Operators List
Java Operators List
Other Operators in java 7
Operators In Java
Core Java Interview Question, Interview Question
Java Training and Tutorials, Core Java Training
Best Java Tutorial for Beginners
Operators
Operators
Operators
Operators
Operators
Relational Operators in java 7
boolean comparisons - tutorial
Java Tutorial
Core Java Interview Question, Interview Question
Auto Increment and Decrement
Deadlock
O - Java Glossary
Java XOR operator
right and left shift operators
Java Program
Master Java In A Week
Logical Operators
WHERE Statement in SQL
THE key Word WHERE in SQL, SQL Tutorial
PHP Operators
An Overview of Java      Java is a programming language      Java is Object Oriented Programming
Operators and Expressions
PHP Assignment Operators
Simple Assignment Operator
GPS Tracking Software

Ads