Yes, it can be done without arrays, but you can't compare booleans with integers in Java.

boolean val1 = true;
if (val1 == 1) // Syntax error
However, you will still need 3 variables to put the...