Question: 2. Create a class called student that implements Comparable Interface and having five data members (name of string type, regno of int type and 3

2. 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 getDetails and putDetails to get and put the student information. Write a findMarkAvg method to return the average of three marks as double value.Define the compare To method to compare the student object based on their regno.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 main method create a TreeSet
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
