set get方法类型问题求解

1 if(row.getCol(2) != null) {
assetInfo.setProperty("" + row.getCol(2));
}
2 public void setProperty(Dictionary property) {
this.property = property;
}

set存进去的值是Dictionary类型的,我想存string类型数据,但是不能改set方法,请问要怎么做到?

参数用字符串,set里面用字符串生成Dictionary

先new一个dictionary
然后把字符串添加进去 dict.add(key,你的字符串)
再把这个dict传进setproperty中。

public void setProperty(Dictionary property) {
this.property = property;
}
这个方法不能修改对吧?
然后实现一个什么效果?