import java.util.ArrayList;
import java.util.List;
public class ListCompApa {
public static void main(String[] args) {
final List<String> gatewaylist = new ArrayList<String>();
gatewaylist.add("namea");
gatewaylist.add("sam");
final List<String> dblist = new ArrayList<String>();
dblist.add("ddd");
dblist.add("lll");
dblist.add("namea");
final List<String> insertList = new ArrayList<String>(gatewaylist);
insertList.removeAll(dblist);
final List<String> removeList = new ArrayList<String>(dblist);
removeList.removeAll(gatewaylist);
System.out.println("gatewaylist ins "+insertList);
System.out.println("dblist rem "+removeList);
}
}
No comments:
Post a Comment