title: System.out.print . How do you get the printed output to be numbered? (Java)
body: <p>So assuming I am printing out a huge record of 500 staff members. And upon printing out the record I would like it to look something like: </p>
  
  <pre><code>   1. Matthew J. $USD 28.404
     2. Donna M. $USD 43.254
     3. Jordan D. $USD 15.532
     4.
     5. 
     6.
     7. and so on......
  </code></pre>
  
  <p>However...with the normal printout command it looks like:</p>
  
  <pre><code>System.out.println();
  </code></pre>
  
  <p>My output :</p>
  
  <pre><code>   Matthew J. $USD 28.404
     Donna M. $USD 43.254
     Jordan D. $USD 15.532
  
  
  
     and so on......
  </code></pre>
  
  <p>EDIT: So how do I get the output to have each line numbered?</p>
  
  <p><strong>LATER EDIT</strong>: </p>
  
  <p>My System.out.print is printing out info out of a list (from a JSON, all that is solved thx to Prasad Khode) here is my code:</p>
  
  <pre><code>for (Manager iterator : managersList) {
  
      System.out.println(iterator.getName() + " - " + iterator.getSalary());
  }
  </code></pre>
  
  <p>This prints out </p>
  
  <pre><code>Name - Salary
  </code></pre>
  
  <p>How can I make it print:</p>
  
  <pre><code>1. Name - Salary
  2. Name - Salary
  </code></pre>
  
  <p>and so on.
  A solution will be so much appreciated. Thanks.</p>