How to store elements in a 2D array and print it (whist reading from a file)
<p>ok so heres my code now .u guys might react with a faceplam but after alot of confusion this is what i came up with now, plz correct all my errors( i suck in programing i know!)    </p>

<pre><code>Scanner in = null;
        try {
            in = new Scanner(new FileReader("C:\\Documents and Settings\\UserXP\\My Documents\\src\\file.txt"));
        } catch (FileNotFoundException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }
        String line="";
ArrayList&lt;String&gt;arrayList=new ArrayList&lt;String&gt;();
while((line=in.nextLine())!=null){
  arrayList.add(line);
  System.out.println(line);

}




         char [][] array = new char [2337][];
            for (int row = 0; row&lt;array.length; row++)


                 if(line=in.nextLine())!=null)
                for(int col = 0; col&lt;line.length(); col++)
                {
                    array[row][col] = line.charAt(col);

                    System.out.print(""+ array[row][col]);
                         }
                         System.out.println("");
                }
}
</code></pre>

<p>this is the error</p>

<p>Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
    Type mismatch: cannot convert from String to boolean
    Type mismatch: cannot convert from boolean to String
    Syntax error on token ")", delete this token
    at read_file.main(read_file.java:129)</p>

<p><strong>if(line=in.nextLine())!=null)</strong> is line 129</p>
