public class MyClass extends Activity {
public static final String DEFAULT_ID = "def";
public static final LinkedHashSet<String> DEF_IDS = new LinkedHashSet<>(Arrays.asList(DEFAULT_ID));
private boolean isDefault(String currentId) {
Log.v(TAG,"isdefault("+currentId+") = " + DEF_IDS.contains(currentId));
return DEF_IDS.contains(currentId);
}
}
在日志中:
isdefault(profile0) = true
怎么回事?如果 DEF_IDS 不包含“profile0”,为什么它说它包含?