+ 1
How to Work with Boolean Numbers in java ?
i just wanna know how can i store a boolaen number like "00100110"( which variable i should use) and "And" it with another 8bit bool number then the result be a boolean too ? should i write a program for this or like Basic language java has a variable to store and operate with boolean numbers ? tnx and sorry for my poor english
3 Answers
+ 2
8bit Boolean? didn't even know it exist.
+ 1
You probably mean binary numbers. The operator AND is a binary / logic-gate operator.
Boolean is more to do with True and False, which can be represented as numbers, but we'd never call a number Boolean.
Here's what you need to do:
https://code.sololearn.com/c6LzepvWI35r/?ref=app
You might find my 'binary and' code here, interesting too:
https://code.sololearn.com/W26dgSxWvWCQ/?ref=app
0
binary number it is not boolean and they are called bits and there are Bitwise operations in java. please get one programming book if you are really serious.