title: not adding a comma at the end in java
body: <p>I want to print out the values in this array of sorts with each value being comma separated in java. However, I do not want my last value to have a comma after it.</p>
  
  <pre><code>for (double val : output.getPvalues()) 
  {
      System.out.print(val + ",");
  }
  </code></pre>
  
  <p>Right now, my output looks like this and I don't want the comma at the end.</p>
  
  <pre><code>0.3151985084814564,0.12439565272818136,0.08395574717762709,
  0.23648887465370277,0.13987884822617208,0.1316174439685804,
  0.23774083903133078,0.14471871035755607,0.16040529724318148,
  0.23138041484992727,0.12692146250237307,0.10444029009575935,
  </code></pre>
  
  <p>Sorry it's my first day in java, and I don't know how to find the length of this object. How can I do it?</p>