package test1;
import java.lang.reflect.Field;
public class GetName {
public static void main(String[] args) {
Word w = new Word();
Field[] fields = w.getClass().getDeclaredFields();
int i =1 ;
for(Field f:fields){
System.out.println(i+++":"+f.getName());
}
}
}
class Word{
private String A;
private String B;
private Integer Num;
private boolean pass;
public void setA(String a) {
A = a;
}
public String getA() {
return A;
}
public void setB(String b) {
B = b;
}
public String getB() {
return B;
}
}