Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started