declaring enums in java


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: declaring enums in java

  1. #1
    Join Date
    Nov 2005
    Posts
    1

    declaring enums in java

    Hi,

    how do you declare enums in java?
    i tried doing:

    private enum Box = {Big, Medium, Small};

    i'm getting a compile time error here, i'm using jdk1.4.2_07 with eclipse3.0.1...
    please advice...

    thanks!

  2. #2
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560
    For that java version I think you must make an extension of the
    javax.print.attribute.EnumSyntax
    In java version 5 you have it ready made:
    java.lang.Enum<E>
    eschew obfuscation

  3. #3
    Join Date
    Dec 2005
    Posts
    5
    Try on eclipse3.1 and use java 5.0 jre for compiling. The you can declare enums and al the new features of Java Tiger release

Similar Threads

  1. Replies: 2
    Last Post: 06-14-2006, 03:16 PM
  2. Java vs. .Net. A questionnaire
    By Basil in forum .NET
    Replies: 1
    Last Post: 05-13-2005, 06:46 AM
  3. DevX does seem one sideded
    By Rob Abbe in forum Talk to the Editors
    Replies: 44
    Last Post: 01-13-2003, 02:57 PM
  4. learning c# very confusing.
    By Mike Tsakiris in forum .NET
    Replies: 11
    Last Post: 10-04-2002, 05:32 PM
  5. Re: VB vs. Visual Age for Java
    By JJ in forum Enterprise
    Replies: 1
    Last Post: 07-06-2000, 04:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center