title: Is the Java method "Arrays.deepToString()" the most efficient way to print a 2D array?
body: <p>I've found similar questions like so:</p>
  
  <blockquote>
    <p><a href="https://stackoverflow.com/questions/19648240/java-best-way-to-print-2d-array">Java - Best way to print 2D array?</a></p>
  </blockquote>
  
  <p>But they don't answer the question of- Is it more efficient?</p>
  
  <p>I'm writing a basic little console game in C# that requires repeatedly clearing and writing to the console in order to refresh the game state. In searching for a more efficient way to do this than my current attempt, iterating through the array with a nested for loop and printing it that way, I found this in Java:</p>
  
  <pre><code>Arrays.deepToString(arrayName);
  </code></pre>
  
  <p>which does what I'm trying to achieve. </p>
  
  <ol>
  <li><p>Is this more efficient than using nested loops in Java like so?:</p>
  
  <pre><code>String[][] map = new String[10][10];
  
  for (int i = 0; i &lt; 10; i++)
  {
      for (int j = 0; j &lt; 10; j++)
      {
          map[i][j] = "=";
      }
  }
  
  boolean firstRun = true;
  
  for (int i = 0; i &lt; 10; i++)
  {
      for (int j = 0; j &lt; 10; j++)
      {
          if (j == 0 &amp;&amp; firstRun == false)
          {
              System.out.print("\n");
          }
  
          System.out.print(map[i][j]);
          firstRun = false;
      }
  }
  </code></pre></li>
  <li><p>If it is more efficient, is there a C# library equivalent? I can't seem to find one or even someone asking about one anywhere.</p></li>
  </ol>