X-Received: by 10.224.72.199 with SMTP id n7mr4866558qaj.5.1361996651878; Wed, 27 Feb 2013 12:24:11 -0800 (PST) X-Received: by 10.49.96.196 with SMTP id du4mr488103qeb.37.1361996651856; Wed, 27 Feb 2013 12:24:11 -0800 (PST) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!usenet.blueworldhosting.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!dd2no3557167qab.0!news-out.google.com!y6ni7qaj.0!nntp.google.com!dd2no3557166qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.java.programmer Date: Wed, 27 Feb 2013 12:24:11 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.28.149.29; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T NNTP-Posting-Host: 69.28.149.29 References: <515de149-3ee1-482d-a090-82ce264ed142@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2ece77fa-d125-4abd-bf44-e72f576f82aa@googlegroups.com> Subject: Re: Enum in Eclipse Scrapbook From: Lew Injection-Date: Wed, 27 Feb 2013 20:24:11 +0000 Content-Type: text/plain; charset=ISO-8859-1 Lines: 24 Xref: csiph.com comp.lang.java.programmer:22590 markspace wrote: > Robert Mark Bram wrote: >> class A { Notice that 'A' is not a top-level class. >> 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 And 'A' is not a top-level class. So make 'A' a top-level class. > What's the name of the file this is defined in? Is it A.java? What > package is this defined in? > > Ditto for the other file you tried. Put the 'enum' in its own source file. Make it a top-level class itself. -- Lew