Nestor,
        I don't think it is like a link list.
In a link list you can search for an element.
Also you can traverse a link list back an forth.
All these are not possible in an enumeration.
In an enumeration you can traverse through it only once and only
in the forward direction.ie. you can only point to the next element and not to the
previous element.

hope that answers your query.

Regards,

Tushar

Nestor Florez wrote:

> Rob,
>
> So is an enumeration like a link list?
>
> Nestor
>
> -----Original Message-----
> From: Rob van Oostrum [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 14, 2000 2:06 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Diff. Bet. Enumeration and Array
>
> An array is a collection of elements keyed by an index number (or, in the
> case of a multi-dimensional array, multiple index numbers, one for each
> dimension). Elements can be directly accessed by this index.
>
> An Enumeration is a collection of elements specifically designed to optimize
> traversing down a list of elements in optimal fashion. The Enumeration does
> not know how big it is. It has a pointer which points to the current
> element. The Enumeration is only able to return the next element, or tell
> whether or not there is a next element. Therefor, the enumeration can only
> be traversed once and is useless after that.
>
> If you want to determine the size of an Enumeration you'll have to do
> something like this:
>
> int count=0;
> while ( enum.hasMoreElements() )
> {
>   enum.nextElement();
>   count++;
> }
>
> System.out.println( "Size of enum is " + count );
>
> hope this helps
> Rob
>
> -----Original Message-----
> Hi,
>
> Pl. can  anybody tell me the difference between an Enumeration and an
> Array.
> Is there any function available to get the count of items in the
> Enumeration.
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to