I'm making a program which allows the user to enter in mark values, and it outputs the number of students in a certain mark range. 

Ex. Level 2 ( (mark >= 60) && (mark < 70) )

Level 3 ( (mark >= 70) && (mark < 80) )

Level 4 (mark >= 80). 

I thought of using a for loop and if statements to see which range each mark falls into, but I can't figure out how to count how many of them fall into which category.

```
ArrayList<Integer> marks = new ArrayList<>();

 private void btnSortActionPerformed(java.awt.event.ActionEvent evt) {                                        

    Collections.sort(marks);
    String output = "";
    for (int i=0; i<marks.size(); i++) {
        output += marks.get(i) + "\n";
    }
    txtOutputSort.setText(output);
}       

```