java - printing out "bank account" info using a toString method
<p>So for an assignment I have to read from a input file that is formated as so: <br>
Miller &lt;--- last name<br>
William &lt;---first name <br>
00001  &lt;--- account ID<br>
891692 06   &lt;--- account balance<br> 
These four lines represent an "account". From a main method I have to call from another class called account and run a method in that class called toString() <br>
toString() is supposed to print out those four lines in this format: <br>
<strong>00001, Miller, William, $891692.06</strong></p>

<p>Here's what I have in my main method so far:</p>

<pre><code> int count = 1;
    while(read.hasNextLine()) {
        String nextLine = read.nextLine();
            account.toString(nextLine);
        if(count %4==0) {
            vector.addAccount(nextLine);
        }
        count++;
    } 
</code></pre>

<p>And this is whats in my toString method:</p>

<pre><code>public String toString(String line) {
 for(int i = 0; i &lt; position; i++){
  line = info[i]; 
    position++;
     }
     return System.out.println(info[2]+", "+info[0]+", "+info[1]+", "+info[3]);
}
</code></pre>

<p>In toString I'm getting an error with the return statement and also I need to format info[3](which should end up being the account balance) so that it will be in dollar notation when it prints like: $00.00</p>

<p>Any help is much appreciated! Thanks!</p>
