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:
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......
However...with the normal printout command it looks like:
System.out.println();
My output :
Matthew J. $USD 28.404
Donna M. $USD 43.254
Jordan D. $USD 15.532
and so on......
EDIT: So how do I get the output to have each line numbered?
LATER EDIT:
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:
for (Manager iterator : managersList) {
System.out.println(iterator.getName() + " - " + iterator.getSalary());
}
This prints out
Name - Salary
How can I make it print:
1. Name - Salary
2. Name - Salary
and so on. A solution will be so much appreciated. Thanks.