public class AppTest {
    private NodeClass nodeClass;

    public static String  hehe = "hehe";

    public String xixi = "xixi";

    public void test() {
        Field[] fields = AppTest.class.getDeclaredFields();
        try {
            for (Field field : fields) {
                field.setAccessible(true);
                if(field.getType().toString().endsWith("java.lang.String") && Modifier.isStatic(field.getModifiers()))
                    System.out.println(field.getName() + " , " + field.get(AppTest.class));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}

 

相关文章:

  • 2022-02-15
  • 2022-12-23
  • 2022-12-23
  • 2021-06-01
  • 2022-12-23
  • 2022-12-23
  • 2021-08-21
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-27
  • 2021-08-11
  • 2021-10-23
  • 2022-12-23
相关资源
相似解决方案