import ;
import ;
public class Test {
public static void main(String[] args) {
List list = ("node", "java", "c++", "react", "javascript");
Object result = (() - 1);
(result);
Object result2 = ().skip(() - 1).findFirst().orElse("no last element");
(result2);
Object result3 = ().reduce((first, second) -> second).orElse("no last element");
(result3);
}
// 同样也可以适用于list<Object>的取值
输出
javascript
javascript
javascript