📜  java enum get nex - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:36.089000             🧑  作者: Mango

代码示例1
public static enum A { 
    X, Y, Z;
    private static A[] vals = values();
    public A next()
    {
        return vals[(this.ordinal()+1) % vals.length];
    }
}