I can not figure out how to output the elements of the array in the console: all even numbers from 1 to 20. Help, please.
public static void main(String[] args) { int [] a = {2, 4, 6, 8, 10, 12, 14, 16, 18, 20}; for (int i = 0; i < a.length; i++) { a[i] = (i+1)*2; System.out.println(Arrays.toString(a)); } }