Search:

Type: Posts; User: aprabhat

Search: Search took 0.18 seconds.

  1. Re: Reading data from a file and setting it to an array

    I suggest it's beneficial for you if you read about scanner class and choose the right method according to your need and file structure.
    you can take a look at scanner class and it's methods Here....
  2. Re: Reading data from a file and setting it to an array

    Is this your input file


    is yes then the problem with your code is
    [code=java]
    demandRate = inputStream.nextInt();
    [code]
    you try to read a line which is "demand rate: 50" using nextInt()...
  3. Re: Reading data from a file and setting it to an array

    Paste the full error message that you get and your code has compilation errors like


    fileName = console.next();


    console is instance of which class? is an instance of Scanner.
Results 1 to 3 of 3