代码摘录
程序员文章站
2024-02-02 15:50:04
...
- PropertyUtils.getSimpleProperty 用法
import org.apache.commons.beanutils.PropertyUtils;
public static void main(String[] args) {
String prop = "fA";
SjjDemoVO t = new SjjDemoVO();
t.setfA("aaa");
String val = "";
try {
val = PropertyUtils.getSimpleProperty(t, prop).toString();
} catch (IllegalAccessException | InvocationTargetException
| NoSuchMethodException e) {
e.printStackTrace();
}
System.out.println("val="+val);
//console: val=aaa
}
上一篇: 汇编语言实现两个多位十进制数相减实验
下一篇: gcc 动态编译