Playing with numbers in Java