java 代码优化

1.List集合类:判断是否有值 if(list != null && list.size() > 0),应当使用这个list.isEmpty()。前者复杂度为o(n) 后者只有o(1)
2.return "/ebid/bidIfmView"; 重复的字符串应该使用 静态变量或者枚举类,一处更新,多出使用。当jsp页面更新的时候,只需要修改一个地方就可以。其他地方字符串变量也一样
 



猜你喜欢

转载自www.cnblogs.com/jkwll/p/11387106.html