title: How to Loop and Print 2D array using Java 8
body: <p>Consider this two dimentional array   </p>
  
  <pre><code>String[][] names = { {"Sam", "Smith"},
                       {"Robert", "Delgro"},
                       {"James", "Gosling"},
                     };
  </code></pre>
  
  <p>Using the classic way, if we want to access each element of a two dimensional array, then we need to iterate through two dimensional array using two for loops.</p>
  
  <pre><code>for (String[] a : names) {
      for (String s : a) {
          System.out.println(s);
      }
  }
  </code></pre>
  
  <p>Is there a new elegant way to loop and Print 2D array using Java 8 features (Lambdas,method reference,Streams,...)?</p>
  
  <p>What I have tried so far is this:</p>
  
  <pre><code>Arrays.asList(names).stream().forEach(System.out::println);
  </code></pre>
  
  <p><em>Output:</em></p>
  
  <pre><code>[Ljava.lang.String;@6ce253f1
  [Ljava.lang.String;@53d8d10a
  [Ljava.lang.String;@e9e54c2
  </code></pre>