Skip to main content



      Home
Home » Newcomers » Newcomers » enum example works with javac but not in Eclipse
enum example works with javac but not in Eclipse [message #78683] Fri, 17 June 2005 10:11 Go to next message
Eclipse UserFriend
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);
}
}
Re: enum example works with javac but not in Eclipse [message #78783 is a reply to message #78683] Fri, 17 June 2005 16:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wharley.bea.com

"Kjell Andersson" <kjellvklart@yahoo.com> wrote in message
news:767d3f61214ab3c6bee338c193c7ed04$1@www.eclipse.org...
> 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?


What build of 3.1? There were some enum-related bugs fixed very recently.

If you are still seeing this with RC2, post to eclipse.tools.jdt.
Re: enum example works with javac but not in Eclipse [message #79290 is a reply to message #78683] Tue, 21 June 2005 03:10 Go to previous message
Eclipse UserFriend
There's no problem with 3.1 RC3.

I got expected output running your example:

Today is Friday
Tomorrow will be Saturday
Yesterday was Thursday
Previous Topic:newbie: debugging applets in an odd environment
Next Topic:help on JDKcontents
Goto Forum:
  


Current Time: Wed Jul 16 09:54:01 EDT 2025

Powered by FUDForum. Page generated in 0.10920 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top