|
I can't seem to wrap my head around how I am meant to solve this issue, I think I am coming from the wrong angle. If I have an class object that contains 3 values, for example Student() and it holds firstName, lastName, studentId. I have then created an array of Student[] objects, so now i am holding something like code:
The other way I was thinking was to make a method that returned the values explicitly as array, for example, Student.getArrayValues() and I guess create a new 2d array list on the fly and then manually sort that through a loop and print the results but it feels like I'm doubling up my work for nothing and there should be a simpler method. Any help would be appreciated
|
# ¿ Apr 9, 2024 10:39 |
|
|
# ¿ May 5, 2024 15:33 |
|
ivantod posted:Maybe this will help you: https://www.baeldung.com/java-8-comparator-comparing. Ahh that is exactly what I was looking for, thanks
|
# ¿ Apr 9, 2024 11:22 |