Double while loop to read a text file
<p>Is it possible to read a text file with a double while/for loop? </p>

<p>I'd like to do something like this:</p>

<pre><code>for( String row1 = 0; row1 &lt; file.length; row1++ ) {

   for( String row2 = row1 + 1; row2 &lt; file.length; row2++ ){

       if( file[row1] == file[row2] ){
            // other code
       }

   }

}
</code></pre>

<p>I need a double loop because I have to find a duplicate row in the file with 2.500.000 rows.
I can't use a Set to save the rows because the heap size is insufficient and if I try to increase it, I get this error: "Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.."  (I've got a Windows 7 64 bit and 8 GB Ram)</p>

<p>Thanks in advance</p>
