I noticed in the solution that the string variable indicating whether the number is "even" or "odd" is declared and initialized to "odd". Then if the number is even, the string is changed to "even". Is there a performance or optimization reason for arranging the code like this?
posted 7 years ago
I asked the same question after the java3 assignment. The reply was that it was shorter, but still very readable.