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

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 object called ts. Create and add 5 student objects in the ts. Create two ArrayListobjects called listl and list2 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, listl and list2 Implement the above said scenario using appropriate swing components

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!