Java: Add two binary numbers

explain me the algorithm