def list =[1,55,28,9,10,23,16]
//升序
list.sort {a,b ->
return a.compareTo(b)
}
//降序
list.sort {a,b ->
return b.compareTo(a)
}
def list =[1,55,28,9,10,23,16]
//升序
list.sort {a,b ->
return a.compareTo(b)
}
//降序
list.sort {a,b ->
return b.compareTo(a)
}