Create a class called student that implements Comparable

 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.

 

Stressed over that homework?

Essay deadline breathing down your neck?

Let’s cut to the chase: Why struggle when you can ace it with zero hassle?

Whether it’s essays, research papers, or assignments — we’ve got you covered.

✅ Expert writers
✅ 100% original work
✅ No AI tools, just real pros

Stressed about your essay or homework? Get a top-quality custom essay NOW!!! Stop worrying. Start succeeding.

GradeEssays.com
We are GradeEssays.com, the best college essay writing service. We offer educational and research assistance to assist our customers in managing their academic work. At GradeEssays.com, we promise quality and 100% original essays written from scratch.
Contact Us

Enjoy 24/7 customer support for any queries or concerns you have.

Phone: +1 213 3772458

Email: support@gradeessays.com

© 2024 - GradeEssays.com. All rights reserved.

WE HAVE A GIFT FOR YOU!

15% OFF 🎁

Get 15% OFF on your order with us

Scroll to Top