我想知道是否有替代方案
List<X> lastN = all.subList(Math.max(0, all.size() - n), all.size());
用流?
java java-8 java-stream
java ×1
java-8 ×1
java-stream ×1