How To Calculate Binary Numbers In Java