Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #22563

Enum in Eclipse Scrapbook

X-Received by 10.224.208.9 with SMTP id ga9mr2982489qab.8.1361944330360; Tue, 26 Feb 2013 21:52:10 -0800 (PST)
X-Received by 10.49.15.100 with SMTP id w4mr47289qec.26.1361944330331; Tue, 26 Feb 2013 21:52:10 -0800 (PST)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news.glorb.com!t2no5312188qal.0!news-out.google.com!y6ni7qaj.0!nntp.google.com!dd2no3410507qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.java.programmer
Date Tue, 26 Feb 2013 21:52:10 -0800 (PST)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=203.11.81.236; posting-account=rjG9lQkAAACg858StY_wJSm2JbVp19Xx
NNTP-Posting-Host 203.11.81.236
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <515de149-3ee1-482d-a090-82ce264ed142@googlegroups.com> (permalink)
Subject Enum in Eclipse Scrapbook
From Robert Mark Bram <robertmarkbram@gmail.com>
Injection-Date Wed, 27 Feb 2013 05:52:10 +0000
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com comp.lang.java.programmer:22563

Show key headers only | View raw


Hi All,

Not sure if this is a bug or if I am going a bit crazy.. Am trying to do some quick testing of enums in an Eclipse jpage Scrapbook (using JDK 1.7.0_02, Win XP 64-bit, Eclipse Juno)

class A {
    enum Month {JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC}
}
A a = new A();

When I try to execute this I get:

The member enum Month can only be defined inside a top-level class or interface

Alternatively, I try moving the enum out of the class definition as below:

enum Month {JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC}
Month.valueOf("JAN");

These are the errors I got for the above:

The member enum Month can only be defined inside a top-level class or interface
Month cannot be resolved

Any advice would be appreciated!

Rob
:)

Back to comp.lang.java.programmer | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Enum in Eclipse Scrapbook Robert Mark Bram <robertmarkbram@gmail.com> - 2013-02-26 21:52 -0800
  Re: Enum in Eclipse Scrapbook markspace <markspace@nospam.nospam> - 2013-02-26 22:25 -0800
    Re: Enum in Eclipse Scrapbook Robert Mark Bram <robertmarkbram@gmail.com> - 2013-02-26 23:04 -0800
      Re: Enum in Eclipse Scrapbook Robert Mark Bram <robertmarkbram@gmail.com> - 2013-02-26 23:17 -0800
        Re: Enum in Eclipse Scrapbook markspace <markspace@nospam.nospam> - 2013-02-27 07:41 -0800
          Re: Enum in Eclipse Scrapbook Jim Janney <jjanney@shell.xmission.com> - 2013-02-27 09:53 -0700
          Re: Enum in Eclipse Scrapbook Robert Mark Bram <robertmarkbram@gmail.com> - 2013-02-27 12:12 -0800
            Re: Enum in Eclipse Scrapbook Lew <lewbloch@gmail.com> - 2013-02-27 12:25 -0800
              Re: Enum in Eclipse Scrapbook lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-02-28 09:02 +0000
                Re: Enum in Eclipse Scrapbook Arne Vajhøj <arne@vajhoej.dk> - 2013-02-28 08:28 -0500
                Re: Enum in Eclipse Scrapbook lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-02-28 15:24 +0000
                Re: Enum in Eclipse Scrapbook Arne Vajhøj <arne@vajhoej.dk> - 2013-02-28 16:48 -0500
                Re: Enum in Eclipse Scrapbook Lew <lewbloch@gmail.com> - 2013-02-28 14:09 -0800
                Re: Enum in Eclipse Scrapbook Arne Vajhøj <arne@vajhoej.dk> - 2013-03-03 21:24 -0500
                Re: Enum in Eclipse Scrapbook Lew <lewbloch@gmail.com> - 2013-03-04 11:36 -0800
                Re: Enum in Eclipse Scrapbook Arne Vajhøj <arne@vajhoej.dk> - 2013-03-07 14:19 -0500
                Re: Enum in Eclipse Scrapbook Lew <lewbloch@gmail.com> - 2013-03-07 13:34 -0800
    Re: Enum in Eclipse Scrapbook Lew <lewbloch@gmail.com> - 2013-02-27 12:24 -0800
  Re: Enum in Eclipse Scrapbook Robert Mark Bram <robertmarkbram@gmail.com> - 2013-02-26 23:28 -0800
  Re: Enum in Eclipse Scrapbook lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-02-27 09:50 +0000
    Re: Enum in Eclipse Scrapbook Robert Mark Bram <robertmarkbram@gmail.com> - 2013-02-27 03:43 -0800
      Re: Enum in Eclipse Scrapbook lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-02-27 12:02 +0000
  Re: Enum in Eclipse Scrapbook Roedy Green <see_website@mindprod.com.invalid> - 2013-02-28 07:43 -0800
    Re: Enum in Eclipse Scrapbook Arne Vajhøj <arne@vajhoej.dk> - 2013-02-28 16:57 -0500

csiph-web