java排ArrayList

java排ArrayList

the lambda
the Collections.sort (A, (X, Y) -> XY); // ascending order
yx // arranged in order from small Avenue

Here Insert Picture Description
If more than one line to write braces

Collections have a sort external addition,
A. .Sort may also add ()

a.sort call is ArrayList.sort
and Collections.sort taking Collections

list write comparater inside
Here Insert Picture Description
so Here Insert Picture Description
you can find out the expression lambad

Published 146 original articles · won praise 3 · Views 2753

Guess you like

Origin blog.csdn.net/weixin_44522477/article/details/104563538