fork download
  1. class Q17{
  2. public static void main(String[] args){
  3. int nums=89;
  4. int sum = 0;
  5. for(int i : nums)
  6. sum += i;
  7. System.out.println(sum);
  8. }
  9. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:5: foreach not applicable to expression type
    for(int i : nums)  
                ^
1 error
stdout

Standard output is empty