I have already searched through the site, finding many resources, none of which answer this question. Consider reading before down voting or marking as duplicate.
I CANNOT USE A COMPARATOR INTERFACE OR .sort()
I have an ArrayList of Photo objects named "photoAlbum" like this ArrayList<Photo> photoAlbum = new ArrayList<Photo>();
where each Photo object contains a String attribute named photographerName
. I need to to sort the Photo objects alphabetically with the photographerName
attribute. I understand that I can use bubble sort or exchange sort, but how can I actually sort the Photo objects themselves inside the photoAlbum
ArrayList based off of each photos photographerName
attribute?
Just tips or generic example would be unbelievably appreciated.
PS I am not allowed to use a Comparator
interface or the .sort
method.