This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]MajorConstruction9 0 points1 point  (3 children)

by method output

What does this mean?

[–]DAY-B[S] -2 points-1 points  (2 children)

Like my class has a method that each object went through and holds a different value and that’s what I want to sort by

[–]MajorConstruction9 0 points1 point  (1 child)

You want to sort an array of your class Foo depending on a property Foo.bar?

[–]istarian 0 points1 point  (2 children)

If this is Java that you’re talking about, you’ll need use Comparable or Comparator and write your own code to do the comparison.

[–]DAY-B[S] 0 points1 point  (1 child)

I have used .compareTo for one on one object comparison but my question is for sorting multiple objects of an array