Search:

Type: Posts; User: newbie

Search: Search took 0.12 seconds.

  1. Replies
    9
    Views
    1,579

    Re: Running into a problem with my program.

    Well now you see, it still tries to access data which isn't there.
    Using while (inputFile.hasNext()), when it reaches the very last token, it will still call your readRecord() method, where it will...
  2. Replies
    9
    Views
    1,579

    Re: Running into a problem with my program.

    In that case, you've only got 2 lines of data, but attempting to retrieve four lines worth of data.

    //fleetVehicles.length is 4!
    for (int i = 0; i < fleetVehicles.length; i++)
    {...
  3. Replies
    9
    Views
    1,579

    Re: Running into a problem with my program.

    Code practices aside, I'd be willing to bet that the reason you're getting that error is because of the blank line in-between your data in the file.
    Remove all empty lines from the file and then...
Results 1 to 3 of 3