这个是enum的方法, values()就是返回所有enum值。你可以理解成List enumList = EnumTest.values();for(EnumTest e:enumList){System.out.println(e.toString);}