It works, it's not the actual source code it's just shows the template I used. getField() refers to any getter method. Object refers to the Object type the list stores.
Type: Posts; User: keepStriving
It works, it's not the actual source code it's just shows the template I used. getField() refers to any getter method. Object refers to the Object type the list stores.
Forgive the late response, just saw your post now, I did the following:
Collections.sort(myList,
new Comparator<Object>()
{
public int...
The objects hold fields, I want the arraylist to sort the objects based on a certain field.
I am trying to sort an ArrayList of objects with the comparator as I want to sort based on a certain value for each object. I understand I would need to override compareTo() in the objects class, is...