39.9k views
1 vote
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 a comparator class to sort student objects by rollno (roll number). Implement your own merge sort method and place your code in a separate Java source file. Do not use a sort method from the Java collections library.

User RasmusW
by
6.0k points

1 Answer

5 votes

Answer:

Following is given the detailed java program as needed.

Last image displays the output of the program

I hope it will help you!

Step-by-step explanation:

Create a Java program that will store 10 student objects in an ArrayList, ArrayList-example-1
Create a Java program that will store 10 student objects in an ArrayList, ArrayList-example-2
Create a Java program that will store 10 student objects in an ArrayList, ArrayList-example-3
Create a Java program that will store 10 student objects in an ArrayList, ArrayList-example-4
Create a Java program that will store 10 student objects in an ArrayList, ArrayList-example-5
User FreePeter
by
5.9k points