如何解决java代码for循环太多呢?这样写
public class forhu {
public static void main(String[] args){
List<Student> stus = new ArrayList<>();
for (int i = 0 ; i < stus.size() ; i++ ) {
Student stu = stus.get(i);
Integer value = gradesMap.get(stu.getId());
if( null != value ) {
System.out.println( "学生:" + stu.getName() + ",成绩:" + value );
}
}
}
}
标签:stus,Java,get,代码,value,stu,循环,public
From: https://blog.51cto.com/u_16190226/7663167