代码优化问题:
1、需要使用对象中的属性值,且是重复调用的;不要放到循环中,避免不断的读取对象(也就是读取内存),降低程序的效率;
List<Student> list = xxx;
for(int i = 0;i<list.size();i++){
}
修改后:
List<student> list = xxxx;
int size = list.size();
for(int i = 0;i<size;i++){
}
原文:https://www.cnblogs.com/lazyli/p/11187471.html