【发布时间】:2016-01-28 00:06:17
【问题描述】:
public static void main(String[] args) {
List<Integer> list = Arrays.asList(4, 5, 6, 7);
list.forEach(x -> {
x = x * 9;
System.out.println(x);
});
JButton btn = new JButton("aa");
ActionListener ae = e -> {};
btn.addActionListener(ae);
List<Student> stds = new ArrayList<>();
for(int i =0; i < 10; i++)
{
stds.add(new Student((int)(Math.random()*100), (int)(Math.random()*100)));
}
System.out.println("Original List");
stds.forEach(x -> System.out.println(x));
System.out.println("\nModified List");
filter(stds,x->x.gpa>15).forEach(x -> System.out.println(x));
System.out.println(convert(51,t->String.valueOf(t)));
}
这是我的讲师代码,它是 100% 正确的,但是当我在我的 PC 上运行它时它给了我错误。我认为问题是我的 IDE??
【问题讨论】:
-
另外,学生也不见了。请添加。
-
您确认您正在使用 Java 8 进行编译吗?