Java for each Loop

Last Updated: March 17, 2022
  int[] marks = { 125, 132, 95, 116, 110 };
  for (int num : numbers){
            System.out.println("Number is " + num);
  }

Output

Number is 125
Number is 132
Number is 95
Number is 116
Number is 110

Test