Matthew Phillips
"Happiness is a way to Travel, <b>Not</b> a Destination" -- Unknown
Matthew Phillips
"Happiness is a way to Travel, <b>Not</b> a Destination" -- Unknown
Originally posted by Carol Murphy:
I have tried to write a simple program using ArrayList and I have hit a wall. Please see my post called "Sort this!!!"
How do you load elements into an ArrayList?
I haven't run across any information on how to do that, so I decided to try and create an ArrayList using the first several names on the list, and I couldn't get the add() method to accept the parameters it's supposed to accept. I'm missing something somewhere........
Originally posted by Carol Murphy:
Also- the word sort to me means to separate a pile of items into smaller, more organized piles of related items, so sorting a list would mean separating it into different, smaller lists.
By sorting, do they mean dividing the list into a list of first names only and then a list of second names only keeping the order constant? I feel like I'm speaking a different language than the rest of you sometimes! I don't understand!!!
Please translate this assignment into simple English for me, so I know exactly what to do! ( I feel like an idiot right now....)
Originally posted by Carol Murphy:
the word sort to me means to separate a pile of items into smaller, more organized piles of related items, so sorting a list would mean separating it into different, smaller lists. By sorting, do they mean dividing the list into a list of first names only and then a list of second names only keeping the order constant?
JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Originally posted by Michael Matola:
The assignment says "Use com.javaranch.common.TextFileIn to read the names." and "Load an ArrayList with Strings from a text file of names."
Check either the JavaDoc or source code for TextFileIn
http://www.javaranch.com/common.jsp
for a great example of how to use that class.
JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Consider Paul's rocket mass heater. |