摘要: 1、for循环遍历list 这种方式的问题在于,删除某个元素后,list的大小发生了变化,而你的索引也在变化,所以会导致你在遍历的时候漏掉某些元素。比如当你删除 第1个元素后,继续根据索引访问第2个元素时,因为删除的关系后面的元素都往前移动了一位,所以实际访问的是第3个元素。因此,这种方式可以用在删 阅读全文
posted @ 2017-05-04 17:27 张主任好 阅读(336) 评论(0) 推荐(0) 编辑
摘要: /** * Returns true if and only if this string contains the specified * sequence of char values. * * @param s the sequence to search for * @return true 阅读全文
posted @ 2017-05-04 16:47 张主任好 阅读(230) 评论(0) 推荐(0) 编辑