公共類測試{
公共靜態void main(String[] args) {
class class 1 = test interface . class;
field[]fields = class 1 . getdeclaredfields();
for(字段字段:字段){
嘗試{
system . out . println(field . getname()+":"+field . get(class 1));
} catch(IllegalArgumentException | IllegalAccessException e){
e . printstacktrace();
}
}
}
}