🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #7554

Re: Help with enumeration!!

#7554
From: Alex Colic
Date: Wed, 06 Jun 2001 18:57
56 lines
2422 bytes
Hi, thanks, pretty stupid error. Fingers typing faster than my brain was
thinking.

I would go to hashmap or iterator but for this hand held project I am stuck
at JDK 1.1.

Alex
"Michael Rachow" <michael@famrachow.de> wrote in message
news:3b1d524e$2_1@dnews...
> Great Tim
>
> I like these kind of errors so much.
>
> Done them with for loops in C/C++ that often.
>
> BTW Alex
> You should become an up to date guy
> by using HashMap and Iterator ;-)
>
> Michael
>
> Tim Dietz <tdietz@telena.com> schrieb in im Newsbeitrag:
> 3b1cf64c$2_2@dnews...
> > If you look at the last character of your "while" statement, you'll find
> > your problem.
> >
> > "Alex Colic" <alex.colic@pop-ware.com> wrote in message
> > news:3b1cf0bb$1_2@dnews...
> > > Help I am having a wierd problem with a hashtable and an enumeration.
> > >
> > > My code is as follows:
> > >
> > > Enumeration enum=hash.keys();
> > >
> > > while(enum.hasMoreElements());
> > >     {
> > >         String key=(String)enum.nextElement();
> > >         System.out.println(key);
> > >     }
> > >
> > > The problem is that the code is indefinately looping at the
> > > 'while(enum.hasMoreElements());' portion. The actial reading of the
key
> > and
> > > displaying it never occurs. I have checked and enum.hasMoreElements is
> > > return true so why is the rest of the statement not being  accessed?
> > >
> > > Any help in understanding the above is appreciated.
> > >
> > > Alex
> > >
> > >
> >
> >
>
>
Technical Details
Message-ID: <3b1e7d1b$1_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news-out.nibble.net!hub1.nntpserver.com!newsfeed1.uni2.dk!newssuck.uni2.dk!dnews
References: <3b1cf0bb$1_2@dnews> <3b1cf64c$2_2@dnews> <3b1d524e$2_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,a708827385327fd7
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-06-06 12:03:53 PST
From: "Alex Colic" <alex.colic@pop-ware.com>
Newsgroups: borland.public.jbuilder.java.language
References: <3b1cf0bb$1_2@dnews> <3b1cf64c$2_2@dnews> <3b1d524e$2_1@dnews>
Subject: Re: Help with enumeration!!
Date: Wed, 6 Jun 2001 14:57:29 -0400
Lines: 58
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 24.150.29.218
Message-ID: <3b1e7d1b$1_1@dnews>
X-Trace: dnews 991853851 24.150.29.218 (6 Jun 2001 11:57:31 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news-out.nibble.net!hub1.nntpserver.com!newsfeed1.uni2.dk!newssuck.uni2.dk!dnews