enum example works with javac but not in Eclipse [message #78683] |
Fri, 17 June 2005 10:11  |
Eclipse User |
|
|
|
Originally posted by: kjellvklart.yahoo.com
Hi!
This example works with javac (version 1.5.0_03) but I don't manage to
make it work in Eclipse with Compiler compliance level: "1.5"
Any Ideas?
Kind regards,
Kjell
public class TryEnumeration {
// Define an enumeration type for days of the week
public enum Day {Monday, Tuesday, Wednesday, Thursday, Friday,
Saturday, Sunday }
public static void main(String[] args) {
// Define three variables of type Day
Day yesterday = Day.Thursday;
Day today = Day.Friday;
Day tomorrow = Day.Saturday;
// Output the values of the Day variables
System.out.println("Today is " + today);
System.out.println("Tomorrow will be " + tomorrow);
System.out.println("Yesterday was " + yesterday);
}
}
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.10920 seconds