随笔分类 -  java

摘要:<> String类型判断为空有三种: Sting number; 1. StringUtils.isBlank(number); 2. numberisEmpty() 3. "".equal(number) || null == number <> int类型判断为空: int number; n 阅读全文
posted @ 2017-11-13 14:30 AoLei 阅读(3006) 评论(1) 推荐(0)
摘要:1.利用cookie对象 Cookie是服务器保存在客户端中的一小段数据信息。使用Cookie有一个前提,就是客户端浏览器允许使用Cookie并对此做出相应的设置。一般不赞成使用Cookie。 (1)后台代码 Cookie cookie=new Cookie("name", "hello"); re 阅读全文
posted @ 2017-01-09 13:39 AoLei 阅读(29393) 评论(0) 推荐(1)
摘要:1.最简单的for循环遍历 for(int i = 0; i < list.size(); i++){ list.get(i); } 2.最方便的foreach循环遍历,在程序中用到的最多 for(String tmp:list){}; 我经常使用这个方法遍历实体,例如: list是查询数据的返回值 阅读全文
posted @ 2016-09-08 15:21 AoLei 阅读(16452) 评论(0) 推荐(0)