Java???????????????е??????
???????????? ???????[ 2013/1/31 11:08:49 ] ????????
?????????????Iterator???????????????α?????????????λ????????????????????ü???????????κ?????
????????????д???С?δ???????????????????????
package com.iss;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Test
{
/**
* @param args
*/
public static void main(String[] args)
{
// TODO Auto-generated method stub
List<String> list = new ArrayList();
for(int i = 0; i<10; i++)
{
list.add("This is" + i);
}
System.out.println("hello");
list.remove("This is1");
for(Iterator iter = list.iterator(); iter.hasNext(); )
{
String str = (String) iter.next();
if(str.indexOf("1") != -1)
{
//????
iter.remove();
//?????
list.remove(str);
}
}
//?????
for(String strs : list)
{
if(strs.indexOf("1") != -1)
{
list.remove(strs);
System.out.println(strs);
}
}
for(String strT : list)
{
System.out.println(strT);
}
}
}
package com.iss; import java.util.ArrayList; import java.util.Iterator; import java.util.List; public class Test { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub List<String> list = new ArrayList(); for(int i = 0; i<10; i++) { list.add("This is" + i); } System.out.println("hello"); list.remove("This is1"); for(Iterator iter = list.iterator(); iter.hasNext(); ) { String str = (String) iter.next(); if(str.indexOf("1") != -1) { //???? iter.remove(); //????? list.remove(str); } } //????? for(String strs : list) { if(strs.indexOf("1") != -1) { list.remove(strs); System.out.println(strs); } } for(String strT : list) { System.out.println(strT); } } }
??????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11