|
|
|
Java - รบกวนช่วยแนะนำวิธีการ Check ค่าใน ArrayList หน่อยค่่ะ |
|
|
|
|
|
|
|
Code (Java)
String[] s1 = {"ram", "raju", "seetha"};
String[] s2 = {"ram"};
List<String> s1List = new ArrayList(Arrays.asList(s1));
for (String s : s2) {
if (s1List.contains(s)) {
s1List.remove(s);
}
else {
s1List.add(s);
}
}
s1List จะได้ค่าที่แตกต่างกัน
|
|
|
|
|
Date :
2014-01-10 11:42:47 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณค่ะ
^^
|
|
|
|
|
Date :
2014-01-15 09:27:18 |
By :
kotchakorn_j |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|