2D array will compile without printing results
<p>For some reason my 2D array will compile and take inputs, but will not actually print the array. It is supposed to be able to print the Array forward and backward, but nothing shows up. Please help!</p>

<pre><code>import java.util.Scanner;
public class Assignment7 {    
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("input row and column dimensions with a space separating them:");
        int[][] array = new int[scan.nextInt()][scan.nextInt()];  // scans input for array dimensions



        for(int row = 0; row &lt; array.length; row++) //row
        {           
            for(int col = 0; col &lt; array[row].length; col++) //column
            {
                array[row][col] = scan.nextInt();
            }
        }
        System.out.println("Array forward");


        for(int row = 0; row &lt; array.length; row++){            
            for(int col = 0; col &lt; array[row].length; col++){
                // print number followed by a space
                System.out.print(array[row][col] + " ");
            }
            System.out.println(); 
        }        
        System.out.println("Array backwards");        
        for(int row = array.length-1; row &gt;= 0; row--){
            for(int col = array[row].length-1; col &gt;= 0; col--)
            {
                System.out.print(array[row][col] + " ");
            }
            System.out.println();
        }

    }

}
</code></pre>
