Question: in Java: say i have a Student class object with 3 String fields: a first name, a last name, and a student ID (although a
in Java:
say i have a Student class object with 3 String fields: a first name, a last name, and a student ID (although a string, studentID consists of numbers.)
i also have a Student array students[9] consisting of:
lastName firstName studentID
Dunn Sean 31111 Duong Geoffrey 29922 Fazekas Nicholas 31100 Prezioso Stefano 22223 Puvvada Mohana 11224 Ravikumar Rakhi 11226 Salyers Matthew 11227 Gillespie William 49587 Hess Caleb 29282
how can i write a method that will sort this array alphabetically/lexicographically, by firstName (or by lastName/studentID)?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
