Article View: aus.computers.java
Article #675Re: Array problem- struggling 1st Year student
From: someguy
Date: Thu, 18 May 2000 00:00
Date: Thu, 18 May 2000 00:00
50 lines
2584 bytes
2584 bytes
hey i know the assignment your doing... by any chance is it for a subject perhaps that might be called 410? hahaha..member you are supposed to implement it in a command line interface instead of a gui as the primary interface. "Alan Boldock" <aboldock@camtech.net.au> wrote in message news:lGHU4.35613$PL4.717065@ozemail.com.au... > Perhaps you should read your streamTokzenizer and retrieve each word > and either stuff them in a Vector or read the file twice and do it the first > time just to get the word count. Use this word count to initialise your > array (to that size) then read the file again putting each word into the > Array. > > A better one pass approach would be to read each word into a Vector > (You don't need to initialise a Vector with a size) then at the end get > the vector size, make the array then use the Vector.copyInto(Object[]) > method to read your Vector into your array. > > There are more sophisticated approaches but for a beginner this is an easy > conceptual approach. > > Alan > > > > "Funtybugwana" <funtybugwana@icqmail.com> wrote in message > news:L1lU4.43$GC4.489545@news0.optus.net.au... > > Can one of you good people please give me a pointer on how to initialise > an > > array with information which I have pulled from a text file.. > > > > The assignment which I have been given is to use arrays to pull all words > > from any document, count occurences of the word and sort it in order..Not > a > > hard task.. well Im dying.. > > > > I have used streamTokeniser to pull in the document using a GUI interface > > which is great but thats about it, I cannot work out how to get that info > > into the array with the text book and lecture notes given... Please help > me > > > > Mark > > > > > >
Technical Details
Message-ID:
<958655346.851548@brs.ihug.com.au>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<L1lU4.43$GC4.489545@news0.optus.net.au> <lGHU4.35613$PL4.717065@ozemail.com.au>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d6db,c27ec22d2383b153 X-Google-Attributes: gid10d6db,public From: "someguy" <someguy@somewhere.com> Subject: Re: Array problem- struggling 1st Year student Date: 2000/05/18 Message-ID: <958655346.851548@brs.ihug.com.au> X-Deja-AN: 624970780 Cache-Post-Path: brs.ihug.com.au!unknown@p78-tnt1.brs.ihug.com.au References: <L1lU4.43$GC4.489545@news0.optus.net.au> <lGHU4.35613$PL4.717065@ozemail.com.au> X-Priority: 3 X-Server-Date: 18 May 2000 13:09:08 GMT X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Organization: The Internet Group (Brsbane) X-MSMail-Priority: Normal X-Cache: nntpcache 2.3.3b4 (see http://www.nntpcache.org/) Reply-To: "someguy" <someguy@somewhere.com> Newsgroups: aus.computers.java