Create a class called student that implements Comparable Interface and having five data members (name of string type, Regno of int type, and 3 subject marks of double type).
Write the methods called get details and put details to get and put the student information.
Write a findMarkAvg method to return the average of three marks as a double value.
Define the compareTo method to compare the student object based on their region.
Create two classes called NameComparator and MarkAvgComparator both implements
Comparator interface to compare the student based on their name and their average marks respectively. In the main method create a TreeSet object called ts. Create and add 5 student objects in the ts. Create two ArrayListobjects called list1 and list 2 for the same 5 students objects and sort the list1 based on student name and sort list2 based on their average marks. Display the ts, list1, and list2.
Enjoy 24/7 customer support for any queries or concerns you have.
Phone: +1 213 3772458
Email: support@gradeessays.com