Solution:
==
has higher precedence than &
. You might want to wrap your operations in ()
to seclude how you want your operands to bind to the operators.
((a[0] & 1) == 0)
Likewis for all parts of the if
condition.
Since &
has a lesser priority than ==
.
Your code is equivalent to a[0] & (1 == 0)
, and if not a[0]
is a boolean this won't compile…
You require to:
(a[0] & 1) == 0
or You can attempt this way
The error message is pretty clear: you can't liken an Object
with an int
.
In case you are certain the low1
collection really conceive int
s, then cast it properly, for example
int x = (int)low1.get(a);
for (int i = 0; i < row; i++) {
if (dc[i][a] == x) {
i1.add(i);
}
}
By the way it would better applying the generic collections (that is ArrayList<E>[^]).