我想从 Java 中的基类访问类的字段。我可以在点网中做到这一点。看例子:
public class a{
// here I want to read the value of name or f1 or f2 or every other field values from derived classes
}
public class b extends a{
public string name;
}
public class c extends a{
public string f1;
public string f2;
}
怎么做?