Skip to content

Comparator to sort the Student objects

M. Hamza Haroon requested to merge task-7-branch-Q3 into main
  1. Write a java program that takes unsorted records of Students inside an ArrayList and sorts them in "Ascending Order" according to student name. NOTE: - If more than one student has the same name, then sort the record according to age, in Ascending Order.
  • Use Comparator to sort the Student objects inside the ArrayList.
  • Student class fields are "id", "name" and "age".

Merge request reports