To classify a class of forty students, let us start the classification on the basis of sexes of the students. This classification will result in the formation of two major groups- boys and girls.
Each of these two groups can be further classified on the basis of the names of the students falling in these groups.
Since it is possible that more than one student can have a particular name, these names can be further divided based on the surnames.
Since there is still some chance that more than one student can have the same surname, the final level of classification will be based on the roll numbers of each student.