Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4331720
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:09:08+00:00 2026-05-21T10:09:08+00:00

I was just roaming through the API and it came to my attention that,

  • 0

I was just roaming through the API and it came to my attention that, Enumerations and Iterators aren’t very useful interfaces.

Specifically I mean, instead of saying (for Vector v):

for (Enumeration<E> e = v.elements(); e.hasMoreElements();)
   System.out.println(e.nextElement());

We can easily say:

for (int i = 0; i < v.size(); i++)
   System.out.println(v.elementAt(i));

What I wanted to know exactly is:

Are there any performance bonuses for using Enumerations/Iterators?

Has it provided you the ability to achieve something that cannot be achieved by the latter for loop?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T10:09:09+00:00Added an answer on May 21, 2026 at 10:09 am

    I don’t think iterators and enumerations are about performance; they’re about better abstraction.

    You don’t need to know anything about the underlying data structure if you have an iterator. That’s why I think that interface is perfectly acceptable. I don’t agree with your statement that Iterator isn’t a useful interface. What methods would you add?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just back from a very nice vacation in Iceland, and await the data roaming
Just wondering what it is that I am doing wrong here?? It's very simple
Just want to mention that I am really a newbie in API development (concepts,
Just doing a pixel-by-pixel comparison of two images that are very similar (one is
just getting my teeth sunk into google maps API. I am attempting to plot
Just had a question regarding the UILabel class. I know that the UITextField control
Just a quick check really. I have an XML file that I will be
Just a quick question. I have an NSArray that is generated in my applicationDidFinishLaunching
I'm using a program that stores its log files at C:\Windows\System32\config\systemprofile\AppData\Roaming\ProgramName\*.log , but for
Certain non-project files that I use Visual studio for (.build, .xml, free-roaming html and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.