Hi All,
I have a long variable in java and am converting it to a binary string, like
long var = 24; Long.toBinaryString(val);
Now this prints only 7 bits, but I need to display all the 64 bits, i.e. all the leading zeros also, how can I achieve this?
The reason is I need to iterate through each bit and perform an operation according to the status, is there a better way to do it?