Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Query Formulation And Administration Using Oracle And PostgreSQL

Authors: Michael Mannino

8th Edition

1948426951, 978-1948426954

More Books

Students also viewed these Databases questions

Question

Can a table be created that does not have a unique key?

Answered: 1 week ago