Java.util.EnumSet.of() 方法 Java.util.GregorianCalendar.get GregorianChange() 方法 Java.util.GregorianCalendar.getLeast Maximum() 方法 Java.util.EnumSet.of() 方法 package com.codingdict; import java.util.*; public class EnumSetDemo { // create an enum public enum Numbers { ONE, TWO, THREE, FOUR, FIVE }; public static void main(String[] args) { // create a set EnumSet<Numbers> set; // add one element set = EnumSet.of(Numbers.FIVE); // print the set System.out.println("Set:" + set); // add another element which replaces the previous set = EnumSet.of(Numbers.THREE); // print the set. Notice that it has one element System.out.println("Set:" + set); } } Java.util.GregorianCalendar.get GregorianChange() 方法 Java.util.GregorianCalendar.getLeast Maximum() 方法