我有一个ArrayList<String>,我想从中删除重复的字符串.我怎样才能做到这一点?
我试着用这样的循环
// ArrayList tourists
for (Tourist t : tourists) {
if (t != null) {
t.setId(idForm);
}
}
Run Code Online (Sandbox Code Playgroud)
但这并不好.谁能建议我一个更好的解决方案?
一些有用的基准可以做出更好的决策: