Como eu mostro apenas os números pares do vetor A? Fiz assim mas não funcionou
public static void main(String[] args) {
int A[] = {12, 4, 8, 3, 10, 15, 21, 9, 18, 2};
int B[] = new int [10];
for(int i=0; i<A.length; i++){
B[i] = A[i]%2;
}
System.out.println(Arrays.toString(B));
}
}