Array initialisation in java December 10, 2023 by Tarik You need this syntax: for(int n : new int[]{1, 2, 3}) System.out.println(n);