import java.io.*; public class test1 { enum Weekday { Mon(7), Tue(6), Wed(5), Thu(3), Fri(3), Sat(3), Sun(1); // must appear first private long day; private Weekday( long d ) { day = d; } } public static void main( String[] args ) { Weekday cday = Weekday.Sat; System.out.println( cday.ordinal() + " " + cday + " " + cday.name() ); // label if ( cday == Weekday.Fri ) { // position System.out.println( "true" ); } // if ( cday < Weekday.Sat ) { // no releation operations // System.out.println( "true" ); // } switch ( cday ) { // position case Mon: case Tue: case Wed: case Thu: case Fri: System.out.println( "weekday" ); break; case Sat: case Sun: System.out.println( "weekend" ); break; } for ( Weekday icday : Weekday.values() ) { // position System.out.print( icday + " " + icday.ordinal() + " " + icday.day + " " + icday.name() + ", " ); // label } System.out.println(); } } // java test1