This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.

"&&" and "||" guarantee you that they operate on the logic values of your variables, not on their bits representation.

"&" and "|" happen to be also logic operators but they operate on the bits level of your variables, no matter on their logical values.

Since true and false happen to represent bits values in Java, there's no problem in this particular case. But "&" and "|" are used for other kinds of low level bitwise operations (changing many 1's and many 0's here and there) required only in a few applications.

Rodolfo Mendoza
Greenhorn

Joined: Feb 27, 2008
Posts: 14

posted

0

Thanks Sergio, Now I know that its possible use the "|" and "&" with logic values of variables.