第一个字母大写
for (Field field:clazz.getDeclaredFields()) { String newField = field.toString().substring(field.toString().lastIndexOf(".")+1); char[] cs = newField.toCharArray(); if (cs[0]>=97 && cs[0]<=122){ cs[0] -= 32; } System.out.println(String.valueOf(cs)); }