Java Enum Get Nex

[Solved] Java Enum Get Nex | Java - Code Explorer | yomemimo.com
Question : java enum get nex

Answered by : zwazel

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

Source : https://stackoverflow.com/a/17006263 | Last Update : Sun, 30 May 21

Answers related to java enum get nex

Code Explorer Popular Question For Java