title: How to flatten a 2-dimensional array into a 1-dimensional array
body: <p>How would i transfer a 2d array into a 1d array in java. I have the code for the 2d array but  dont know where to start. 
  The output of the 2d array is a 8 by 10 grid with the numbers going from 1-80.</p>
  
  <pre><code>public class move
  {
      public static void main (String[] args)
      {
  
          int[][] twoarray = new int[8][10];
  
          int i ;
          int j ;
  
          for(i =0; i &lt; 8; i++)
          {
              for(j = 0; j &lt; 10; j++)
              twoarray[i][j] = (i * 10 + j+1);
          }
  
  
          for(i = 0; i &lt; 8; i++)
          {
              for(j = 0; j &lt; 10; j++)
              {
                  System.out.print(twoarray[i][j]);
                  System.out.print("  ");
  
  
              }
              System.out.println();
          }
  
          int[] array = new int[80];
  
      }
  }
  </code></pre>