Question: Given the following class definition write a compare to function which will sort the objects in Alphabetical order by last name. class Student {
Given the following class definition write a compare to function which will sort the objects in Alphabetical order by last name. class Student { int id; String firstName; String lastName; }
Step by Step Solution
There are 3 Steps involved in it
java public int compareToStudent other return thislastNamecompareTootherlastName This code defines ... View full answer
Get step-by-step solutions from verified subject matter experts
