enum Rainbow { RED, ORANGE, YELLOW, GREEN, BLUE, INDIGO, VIOLET }
public class prog {
public static void main(String[] args) {
int idx = Rainbow.YELLOW.ordinal();
System.out.println(idx);
}