package com.javacollection.www;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
public class cullectionDmeo{
private static String space=" ";
public static void main(String[] args) {
//我有个字符串数组
String str="I am man";
//分解为多个字符串
String[] str1=str.split(space);
StringBuffer sb=new StringBuffer();
/*sb.append("[");
for(int i=0;i<str1.length;i++){
if(i<str1.length-1){
sb.append(str1[i]);
}else{
sb.append(str1[i]+"]");
}
//System.out.println(str1[i]);
}
//System.out.println(sb);
*/
Collection cul=new ArrayList();
Collection cu2=new ArrayList();
/**
* 把str1中的字符串组添加进去
*/
cul.add(str1[0]);
System.out.println(cul);
//把str1中的全部元素添加进去
//cul.add(sb);
//System.out.println(cul);
for (int i = 0; i < str1.length; i++) {
//System.out.print(str1[i]+" ");
}
cu2.addAll(cul);
System.out.println(cu2);
cu2.removeAll(cul);
System.out.println(cu2);
}
}