SyntaxFix
Write A Post
Hire A Developer
Questions
In Java 8:
Arrays.sort(files, (a, b) -> a.getName().compareTo(b.getName()));
Reverse order:
Arrays.sort(files, (a, b) -> -a.getName().compareTo(b.getName()));