gpt4 book ai didi

java - 如何从 JAVA 中的两个集合中获取不匹配的字符串?

转载 作者:行者123 更新时间:2023-11-29 06:33:55 26 4
gpt4 key购买 nike

我应该如何只获取一次不匹配的元素?我的代码如下:

Set<String> hashSet = new HashSet<String>(); //consist 90 elements
Set<Object> hashSet2 = new HashSet<Object>();// consist 9 elements
for (String string : hashSet ) {
for(Object obj: hashSet2){
if(obj.equals(string)){
System.out.println(string + "\t is present in tracking sheet");
}
if(!obj.equals(string)){
System.out.println(string + "\t is not sheet");

}
}

}

首先使用 if() 我能够获得两个集合中的元素。使用第二个 if() 我得到了第一组中所有元素的结果。

输出: GBS-40747 不在表中

GBS-40747    is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is present in tracking sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-40747 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is present in tracking sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-35562 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is present in tracking sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
GBS-39321 is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
0.8 build is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is present in tracking sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-39421 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-38455 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is present in tracking sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-40695 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-38467 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet
GBS-41315 is not in sheet

感谢大家提供意见和解决方案。我选择了一个作为可接受的答案(KISS:保持简短)(如果允许的话会选择更多 :-)),但很多都是有帮助的。

最佳答案

就这样吧:

Set<String> hashSet = new HashSet<String>(); // consist 90 elements
Set<Object> hashSet2 = new HashSet<Object>(); // consist 9 elements
for (String string : hashSet) {
if (hashSet2.contains(string)) {
System.out.println(string + "\t is present in tracking sheet");
} else {
System.out.println(string + "\t is not sheet");
}
}

关于java - 如何从 JAVA 中的两个集合中获取不匹配的字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25279033/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com