Article View: borland.public.jbuilder.java.language
Article #7550Re: Help with enumeration!!
From: Michael Rachow
Date: Tue, 05 Jun 2001 21:44
Date: Tue, 05 Jun 2001 21:44
44 lines
2040 bytes
2040 bytes
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:
<3b1d524e$2_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!isdnet!newsfeed.icl.net!skynet.be!newsfeed00.sul.t-online.de!t-online.de!news1.dtag.de!news.gwi-ag.com!dnewsReferences:
<3b1cf0bb$1_2@dnews> <3b1cf64c$2_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 15:14:25 PST From: "Michael Rachow" <michael@famrachow.de> Newsgroups: borland.public.jbuilder.java.language References: <3b1cf0bb$1_2@dnews> <3b1cf64c$2_2@dnews> Subject: Re: Help with enumeration!! Date: Tue, 5 Jun 2001 23:44:54 +0200 Lines: 46 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 NNTP-Posting-Host: 217.81.80.101 Message-ID: <3b1d524e$2_1@dnews> X-Trace: dnews 991777358 217.81.80.101 (5 Jun 2001 14:42:38 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!isdnet!newsfeed.icl.net!skynet.be!newsfeed00.sul.t-online.de!t-online.de!news1.dtag.de!news.gwi-ag.com!dnews