I have a list of dogs with their name, breed, age, weight and tail length. I have already sorted the list by tail length and am now supposed to sort the dogs that have the same tail length by their name. For example this is how the list should look like:
Charlie Golden 2years 3kg 2.0cm
Bob Bulldog 3years 4kg 3.3cm
Lucy Golden 4years 3kg 3.3cm
Molly Bulldog 5years 7kg 5.2cm
I have a method called sortTail() that sorts by tail length and a method sortName() that sorts by name.
sortTail()
ArrayList<Dog> dogs = new ArrayList<>();
sortName()
What should I do in between to only sort the ones with the same tail length?