This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi Folks, I made a post a while ago called Manipulating Binary Numbers. Basically what i am trying to do is make an LED. I need to read a Byte of input & where there is a 0 in the binary input, the corresponding 'segment' of the LED is lit. I received the following in reply to my last post:
Where 'charWord' is declared as:
But, when i try to run this i get the following error from the compiler: "operator & cannot be applied to byte,boolean" Does anyone know how i can apply the binary AND operator in Java? Thanks & Regards, Celine
We've heard that a million monkeys at a million keyboards would eventually reproduce the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true.<br />- Robert Wilensky
- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. - What truth? - That there is no spoon!!!
Joined: Nov 22, 2003
Guys, I changed the brackets & it works perfectly. Also, i set up variables for the bytes i needed to compare my word to - 0000001b etc. were not valid but 'byte one = 1;' is very valid! The guy that replied to the last post was totally on the right track. This is perfect for what i need. You are all lifesavers! Thank you so much! Best Regards, Celine