I have ArrayList zombie, which is populated with an object called Zombie. Zombie has the attributes health, x, y. How would I sort the array in ascending order, using the attribute x of Zombie, which is set to initially have random values?
I have already found a possible solution to my problem, but I do not understand the syntax of the answer. Explaining that answer may help, also.