动态变量名称Java
我如何能够检索具有动态名称的变量的值
例如,我有常量列表
public class Constant{ public static final String S_R = "Standard(240)"; public static final String S_W = "Standard(180)"; public static final String L_R = "Large(360)"; public static final String L_W = "Large(280)";}
基于数据库,我构建了一个变量名
String varName = "S" + "_" +"R"; // This can be S_R , S_W , L_R or L_W String varVal = // How do i get value of S_R
胡子哥哥
红糖糍粑
繁星coding
相关分类