public class Test {
public static void main(String[] args) {
//add()和remove()方法在失败的时候会抛出异常(不推荐)
Queue<String> queue = new LinkedList<String>();
String conIds="1,2,3,4,5,6,7,8,1,2,14,58,6";
String telIds="1,2,3,4,54,6,78,9,54,61,32,14,57,96,451";
String[] idList = conIds.split(",");
String[] idLists = telIds.split(",");
for (int i = 0; i < idLists.length; i++) {
queue.offer(idLists[i]);
}
for (int i = 0; i < idList.length; i++) {
String a= queue.poll();
System.out.println(idList[i]+"分配"+a);
queue.offer(a);
}
}
}
网友评论