Results 1 to 2 of 2

Thread: Java Question

  1. #1
    numba1xclusive's Avatar Xclusive Gangsta
    Join Date
    Jan 2004
    Posts
    208
    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..

    Da Numba1Xclusive King

  2. Software & Hardware   -   #2
    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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •