How to Write a program which will take 001010101110000100100
...., 011100010001000011000
...., 000000000010000000000100
.... as input (bit) and the output will be OR
of these 3.
OR = 0 0 = 0,
0 1 = 1,
1 0 = 1,
1 1 = 1,
if sombody has a sample program that would be helpful too. Do we need to store the values in bit array from byte?
This should work (update: bug fixed):
Sample code:
Output:
Can't you just call the
or
method in the BitSet class?[edit] Assuming you wanted an example, something like this should work: