set & generics in java
set & generics
Set<String> sSet = this.mTables.keySet();
for (Object obj: sSet) {
if(obj instanceof Integer){
int i= (Integer)obj;
}else if(obj instanceof String){
String s = (String)obj;
System.out.println(s);
}
}
Set<String> sSet = this.mTables.keySet();
for (Object obj: sSet) {
if(obj instanceof Integer){
int i= (Integer)obj;
}else if(obj instanceof String){
String s = (String)obj;
System.out.println(s);
}
}
评论
发表评论