Question: Can someone please translate what this compareTo method is doing? To give some context, the assignment is to take two arraylists of Person class type
public int compareTo(Person o) { int last = this.email.compareTo(o.email); //Sorting by first name if last name is same d return last == 0 ? this.email.compareTo(o.email) : last
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
