🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Help with enumeration!!

#7543
From: Tim Dietz
Date: Tue, 05 Jun 2001 15:09
28 lines
1687 bytes
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: <3b1cf64c$2_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews
References: <3b1cf0bb$1_2@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-05 08:26:18 PST
From: "Tim Dietz" <tdietz@telena.com>
Newsgroups: borland.public.jbuilder.java.language
References: <3b1cf0bb$1_2@dnews>
Subject: Re: Help with enumeration!!
Date: Tue, 5 Jun 2001 08:09:22 -0700
Lines: 30
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
NNTP-Posting-Host: 207.110.36.206
Message-ID: <3b1cf64c$2_2@dnews>
X-Trace: dnews 991753804 207.110.36.206 (5 Jun 2001 08:10:04 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews