title: how do I generate histogram output from an array in Java?
body: <p>so I have a method that I call to my main which takes an array of 10 numbers and creates a histogram output in a nested for loop. I can't figure out how to get the correct number of asterisks next to the row title. The array is passed to the method from a previous method. Thanks!!   </p>
  
  <pre><code>public static void outputHistogram(int [] list)
  {
  
      int k =0;
      for(int i=0;i&lt;=9;++i)
      {
          System.out.print((i*10+1) +"-"+(i*10+10)+":"+"\t");
  
          for(int j=1; j&lt;=i;++j)  
              System.out.print("*");
  
  
          System.out.println();   
      }
  }
  </code></pre>