by akeefer · 17y ago · 0 comments
To use their example, it should be much more like:
Collections.sort(list, \str1, str2 -> str1.length() - str2.length());
instead of:
Collections.sort(list, #(String str1, String str2) { return str1.length() - str2.length(); });
There's no technical reason you couldn't do the former in Java (and their proposal seems to infer the return type just fine?), but no one involved with the Java language seems to really value conciseness.
No comments yet.