摘要:
今天在用ArrayList类的caontains方法是遇到了问题,我写了一个存放User类的ArrayList 但在调用list.contains(user)时总是返回false。 去看了下ArrayList的源码,源码如下: 1 public boolean contains(Object o) { 2 return indexOf(o) >= 0; 3 } 4 5 6 public int indexOf(Object o) { 7 if (o == null) { 8 for (int i = 0; i < siz... 阅读全文
posted @ 2013-03-27 13:41
依凡兄
阅读(428)
评论(0)
推荐(0)

浙公网安备 33010602011771号