title: Java: write an array into a text file
body: <p>I'm trying to write a matrix into a text file. 
  In order to do that I'd like to know how to write an array into a line in the text file.</p>
  
  <p>I'll give an example:</p>
  
  <p>int [] array = {1 2 3 4};</p>
  
  <p>I want to have this array in text file in the format:</p>
  
  <pre><code>1 2 3 4
  </code></pre>
  
  <p>and not in the format:</p>
  
  <pre><code>1
  2
  3
  4
  </code></pre>
  
  <p>Can you help me with that?</p>
  
  <p>Thanks a lot</p>