Storing an ArrayList Create a Java program that will store 10 student objects in an ArrayList, ArrayList. A student object consists of the following fields: int rollno String name String address Implement two comparator classes to sort student objects by name and by rollno (roll number). Implement your own selection sort method and place your code in a separate Java source file. Do not use a sort method from the Java collections library.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter9: Using Classes And Objects
Section: Chapter Questions
Problem 9E
icon
Related questions
Question

Storing an ArrayList

Create a Java program that will store 10 student objects in an ArrayList, ArrayList<Student>. A student object consists of the following fields:

  • int rollno
  • String name
  • String address

Implement two comparator classes to sort student objects by name and by rollno (roll number). Implement your own selection sort method and place your code in a separate Java source file. Do not use a sort method from the Java collections library.

Option #1: Storing an ArrayList
Create a Java program that will store 10 student objects in an ArrayList, ArrayList<Student>. A student object
consists of the following fields:
●
int rollno
String name
String address
Implement two comparator classes to sort student objects by name and by rollno (roll number). Implement your
own selection sort method and place your code in a separate Java source file. Do not use a sort method from the
Java collections library.
Transcribed Image Text:Option #1: Storing an ArrayList Create a Java program that will store 10 student objects in an ArrayList, ArrayList<Student>. A student object consists of the following fields: ● int rollno String name String address Implement two comparator classes to sort student objects by name and by rollno (roll number). Implement your own selection sort method and place your code in a separate Java source file. Do not use a sort method from the Java collections library.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 3 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

Instead of displaying the information on the console is it possible to implement a simple graphical user interface to display the data? What would that look like? Also, can you identify where the selection sort method is in the program

Please and thank you!

Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage