You need to place your codes inside any function, constructor or static block, correct it as:
class Test{ public static void main(String[] args) { int [] arr = {3,26,8,4,79}; } for (int i=0;i<5 ;i++ ) { System.out.println(arr[i]); } }