Results 1 to 4 of 4

Thread: Enumeration

  1. #1
    kishan's Avatar
    kishan is offline Member
    Join Date
    Apr 2009
    Posts
    57
    Rep Power
    0

    Default Enumeration

    Hi all
    what is Enumeration in java?(is it a class or Keyword)
    What is the use of Enumeration?

  2. #2
    Singing Boyo is offline Senior Member
    Join Date
    Mar 2009
    Posts
    552
    Rep Power
    6

    Default Enumeration (Interface) or enums

    Are we talking about the interface (which has been replaced with Iterator) or enums?

    enums are a form of a class, represented by java.lang.Enum. They can hold methods, variables, and also hold enum constants. (A fixed set of variables that also implement any abstract methods declared by the enum) enums should be used whenever you have a fixed set of constants where the values are known at compile time. See Enum Types in The Java Tutorials for more information.

    Enumeration (the interface) and Iterator are tools for processing arrays/vectors.
    If the above doesn't make sense to you, ignore it, but remember it - might be useful!
    And if you just randomly taught yourself to program, well... you're just like me!

  3. #3
    venkatallu is offline Member
    Join Date
    Sep 2008
    Posts
    16
    Rep Power
    0

    Default

    Enumeration is not a class or key word;
    it is a interface.By using this interface
    we iterate the elements of a collection.
    It is just like an Iterator interface.

  4. #4
    Singing Boyo is offline Senior Member
    Join Date
    Mar 2009
    Posts
    552
    Rep Power
    6

    Default

    Old thread... over a week, and OP did not reply. No need to post on this one.
    If the above doesn't make sense to you, ignore it, but remember it - might be useful!
    And if you just randomly taught yourself to program, well... you're just like me!

Similar Threads

  1. Using the built-in enumeration methods
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-17-2008, 08:35 PM
  2. Using Enumeration to iterate through Hashtable
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-15-2008, 09:44 AM
  3. Replies: 0
    Last Post: 01-04-2008, 10:34 AM
  4. Declaring Enumeration
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-04-2007, 06:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •