Reading file input data and loading it into an Array
<p>I'm working on a program that reads data from a file and inputs it into an array. It seems like it should work, however I get an odd output from the program (no error, it runs, just gives me a weird result).</p>

<p>Here's my code:</p>

<pre><code>    Scanner s = new Scanner(new File("../Computer/src/computers/computer.txt"));
    String[] comps = new String[2];

    int i = 0;

    while (s.hasNextLine()) {
        comps[i] = s.nextLine();
        i++;
    }
    s.close();

    System.out.println(comps);
</code></pre>

<p>The output that I get is:</p>

<pre><code>[Ljava.lang.String;@3d62b333
BUILD SUCCESSFUL (total time: 1 second)
</code></pre>

<p>Also, my text file looks like this, if it's a problem with my text file:</p>

<pre><code>12344555 Dell Intel 499.99
23623626 Asus AMD 299.99
</code></pre>
