Results 1 to 3 of 3
  1. #1
    muhsy is offline Member
    Join Date
    Jan 2011
    Posts
    1
    Rep Power
    0

    Default Enumerated Types

    I recently discovered that enum type is a special class, constructors can be formed, instance variables, and the enum data declaration can posses a primitive type.

    My question is, in the general sense:

    Java Code:
    private enum Foo {
    COMMA (","),
    SEMICOLON (";");
    private String poo 
    Foo (String poo) {
    this.poo = poo;
    private String poo {return poo};
    }
    I would like to better understand this. I know I can create a variable of Foo such as Foo morePoo and access the , and ; using the names but I just don't know how well. Strong application in parsing and compiler design.

    Thank you for the info

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,300
    Rep Power
    20

Similar Threads

  1. A default Enumerated type
    By Newbie666 in forum New To Java
    Replies: 0
    Last Post: 04-17-2010, 04:57 AM
  2. Help with sorting two types:
    By twcast in forum New To Java
    Replies: 2
    Last Post: 02-11-2010, 04:37 PM
  3. types of stacks
    By vendetta in forum New To Java
    Replies: 3
    Last Post: 02-06-2010, 03:58 AM
  4. how do I Parse Enumerated types?
    By gcampton in forum New To Java
    Replies: 5
    Last Post: 10-12-2009, 10:41 AM
  5. Problem using enumerated types
    By Stryker4526 in forum New To Java
    Replies: 3
    Last Post: 10-10-2009, 03:57 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
  •