我怎样才能获得int值?我不反对。 http://hastebin.com/ovudovotah.avrasm我需要this.d.as
,那是什么方式?有人可以让我上路吗?我尝试了所有的东西,但是我总是在所有其他教程中坚持使用对象,我看到人们反对#get方法,但我没有对象..
答案 0 :(得分:1)
如果您有对象的引用,请将其称为x,您可以非常轻松地从公共字段中获取值:
Object x = ...; // get it from somewhere
try {
x.getClass().getDeclaredField("as").get(x);
} catch(Exception ex) {
//do error handling here
}
当然,这只是基本的,只适用于公共领域,很容易,这不是好的风格。