-
Xclusive Gangsta
Ok, I have to write a prgm that basically finds the age of each "passenger" on this fictional ship. I'm using a buffered reader, and I have to use Arrays. my problem comes, how do I tell it to find an int? The line of the txt file looks somewhat like this. there are 250 names.
ARLE Susan 21 London Female Penitentiary,Pentonville.
I'm seriously a Java noob..
-
-
03-29-2005, 02:32 PM
Software & Hardware -
#2
Retired
Read a single line (one person) using readLine()
Use a StringTokanizer to split this string in multiple strings (using the space a splitting point).
Third string is the age. Create a new Integer from the String and use intValue() to get an int.
http://java.sun.com/j2se/1.4.2/docs/api/index.html
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks