Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners What is the difference between the Boolean & operator and the && operator?
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Java Coder
What is the difference between the Boolean & operator and the && operator?
1 Answer(s)      a year and 6 months ago
Posted in : Java Beginners


Hello,

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

thanks,


Advertisement
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:
Advertisements
 

 

 

DMCA.com