How to sort a list out of objects by an int property of the objects
Hey! 👋
I am currently writing a path finding program and I need help at sorting a list out of objects by an int property of the objects.
Is there anybody who had this problem before and can help?
Thanks in advance
19 Replies
⌛
This post has been reserved for your question.
Hey @Roasty! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
I tried the exact same thing as on the website but it always prints the following error:
This is the class:
I am trying to sort the list "knotenTabelle" of the class "KnotenTabelle" by the int property "gesamtDistanz"
This is how the list was created:
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
That's the method. The last two lines cannot be seen, but they are irrelevant since it just says
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
if I remove the one line then it is not throwing the error
so it must be caused by the sorting
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
more colors in IDE is not gay btw
having everything in gray will make you bliiind
how can I change that?
I am using IntelliJ
Get More Themes
and chose one from here ^
thanks a lot 🙃
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
Post Closed
This post has been closed by <@500619197760536586>.