Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java get next enum

public static enum A { 
    X, Y, Z;
    private static A[] vals = values();
    public A next()
    {
        return vals[(this.ordinal()+1) % vals.length];
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #enum
ADD COMMENT
Topic
Name
5+1 =