Hamming code assignment written in java