Analyze the following code: Code 1: boolean even; if (number % 2 == 0) even = true; else even = false; Code 2: boolean even = (number % 2 == 0);
A.
Code 2 has syntax errors.
B.
Code 1 has syntax errors.
C.
Both Code 1 and Code 2 have syntax errors.
D.
Both Code 1 and Code 2 are correct, but Code 2 is better.