+ 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

22nd Apr 2018, 9:57 AM
Iman Mohammadi
Iman Mohammadi - avatar
3 Answers
+ 2
8bit Boolean? didn't even know it exist.
22nd Apr 2018, 10:27 AM
Sergey Semendyaev
Sergey Semendyaev - avatar
+ 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
22nd Apr 2018, 10:43 AM
Emma
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.
29th Apr 2018, 7:19 PM
Rajat Naik
Rajat Naik - avatar