标签: java arrays sorting comparable
我想按照许多标准对事物进行排序,但事件/方法不同。 例如,有2个选项:1。按名称排序2.按生命点排序
public class MonsterArray implements Comparable<Monster>{ ...... public int compareTo(Monster m) { //what must i code here } }
我可以使用比较吗?或者必须使用其他类型。 请帮帮我:)。