This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Arrays and objects....

 
Kate ryan
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,
I'm trying to write a program which reads in a sequence of lines, containing a name and telephone number and sorts it into an alphabetically ordered telephone directory. I was just wondering if anyone would be able to tell me how I could read in an unlimited amount of input...??
Thanks in advance...
 
Steven Bell
Ranch Hand
Posts: 1071
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you can't just read in an unlimited amount of input. There are system and memory limitations depending on what you are running on. What you could do is read in a certain amount, process it, save it, and then get the next chunk.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instead of using an array, which has to be allocated at a specific, fixed size, you can use a List (for example, java.util.ArrayList) which grows as needed. In JDK 1.5:

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic