Define the compareto method to order student objects


Discussion

Modify the Student class so that it implements the Comparable interface. Define the compareTo method to order Student objects based on the value in studentNumber. In a main method create an array of at least four Student objects, sort them using Arrays.sort, and print out the students in the array. They should be listed by ascending student number. Next, modify the compareTo method so it orders Student objects based on the lexicographic ordering of the name variable. Without modification to the main method, the program should now output the students ordered by name.

The response should include a reference list. Double-space, using Times New Roman 12 pnt font, one-inch margins, and APA style of writing and citations.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Define the compareto method to order student objects
Reference No:- TGS03023737

Expected delivery within 24 Hours