which interface should a class implement so that it can be sorted based on many fiels/criteria
Answers
Answered by
0
Answer:
If any class implements Comparable interface in Java then collection of that object either List or Array can be sorted automatically by using Collections. sort() or Arrays. sort() method and objects will be sorted based on there natural order defined by CompareTo method.
Similar questions