+1 vote
in I have a screenshot by (21.2k points)

I tried to compile a simple java file in CMD, then it gave me a bunch of errors above. And I'm sure the every code is correct. Below is a screenshot of the original codes:
 

1 Answer

+1 vote
by (4.6k points)
selected by
 
Best answer

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]);
    }
}

Welcome to Best solution for PC & Software errors, where you can ask questions and receive answers from other members of the community.
...