java 代码优化

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



posted @ 2019-08-26 23:18  wullll  阅读(173)  评论(0编辑  收藏  举报