title: How to print a list without square brackets?
body: <p>I need to print a list in java. This is the way I know to print it:</p>
  <pre class="lang-java prettyprint-override"><code>import java.util.ArrayList;
  import java.util.List;
  
  public class DoubleArray {
      private List&lt;List&lt;Double&gt;&gt; listOfArray;
      public void createArray() {
          ConeCurve obj = new ConeCurve();
          int rows = (int) (((obj.getMaxX()) - (obj.getMinX())) / (obj.getStepSize()) + 1);
          int columns = (int) (((obj.getMaxY()) - (obj.getMinY())) / (obj.getStepSize()) + 1);
          double x = obj.getMinX();
          double y = obj.getMinY();
  
          listOfArray = new ArrayList&lt;&gt;(rows);
          for (int i = 0; i &lt; rows; i++) {
              listOfArray.add(new ArrayList&lt;&gt;(columns));
          }
          for (int row = 0; row &lt; rows; row++) {
              x = obj.getMinX();
              for (int column = 0; column &lt; columns; column++) {
                  listOfArray.get(column).add(obj.getZ(x, y));
                  x += obj.getStepSize();
              }
              y = y + obj.getStepSize();
          }
      }
  
      public void printArray() {
          for (List&lt;Double&gt; element : listOfArray) {
              System.out.println(element);
          }
      }
  }
  </code></pre>
  <p>The output is fine but it is in the form <code>[ output....]</code>.
  The name and format of the method must not be changed. I am trying to print the list without the <code>[]</code> (square) brackets. If anyone can help it would be much appreciated.</p>
  <p>I uploaded the full code, the obj is only used to call values from a different class.</p>