Hi,I am currently working on a program to count bits in a byte array with 8 elements in Java. that is actually 64 bits in total.

Of course,I can cast each individual byte to integer,then keeping divide it by 2,get the remainder,until quotient is zero,just

count remainder if remainder is 1.I think it is too messy,is there an easy and efficient way ?

Thanks in advance for help.

nancen