我有一个类中的常量列表,例如:
public class constants{
public String avg_label ="......";
public String count_label="......";
}
调用时,是否可以执行以下操作:
public class MapDialogue{
Constants c1 = new Constants();
public String mappingLabels(String node){
String text = "c1."+node+"_label";
//Is there someway of parsing this text as code
//like in unix shell scripting?
}
}