One day I was thinking of how to handle an array of bits so I can use it to mark some information of another array. After checking below thread final I've made my own class to handle it. As I am not a very good coder I may have made careless mistake but still want to put it here for my future reference and whoever passes by here please do leave me some comment about it so I can improve myself. /** * Create a simple class containing an array of bits. * * @author Whelan Chan * */ public class BitArray{ private long bitX64[] = null; private final static int BIT_SIZE = 64; public BitArray(int size) { bitX64 = new long[size / BIT_SIZE + (size % BIT_SIZE == 0 ? 0 : 1)]; } public boolean getBit(int pos) { return ((bitX64[pos / BIT_SIZE] >> pos & 1l) == 1l); } public void setBi...