Returns the ordinal of this enumeration constant (its position in its enum declaration, where the initial constant is assigned an ordinal of zero). Most programmers will have no use for this method. It is designed for use by sophisticated enum-based data structures, such as EnumSet and EnumMap.

To test out this theory, I inserted a statement "System.out.println(t.ordinal());" after "Roman t = Roman.X;" statement. The output is 2, because Roman.X ordinal (order sequence) is 2 (see ordinal sequence above). This verifies that the theory is correct.

Next, I ran a debugger and monitor the while loop. The statement "case L: if(t.ordinal()>2) z+=5;" iterated through the while loop three times. It does this because of the x<10 condition.