File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trying to print contents of object filled array list.

 
Edward Strife
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to print a sales report with each members name and their percentage of sales and expenses. I should be using a loop that runs the length of the sales list and use next() method to get each salesperson and then my observer methods to return the information about the salesperson. Something isn't right.

 
E Armitage
Rancher
Posts: 989
9
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Something isn't right.


What happens when you try to compile/run the program?
 
Edward Strife
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I only get the sales total and expense total, however I have tried numerous ways to print each person with their percentages to no avail.
 
E Armitage
Rancher
Posts: 989
9
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should write a loop that goes through the values in your SortedList
 
Winston Gutkowski
Bartender
Pie
Posts: 9477
50
Eclipse IDE Hibernate Ubuntu
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston Gutkowski wrote:Have one class that converts data to a List of SalesPersons...

It also occurred to me that what you probably actually want is a java.util.Set<SalesPerson>. That way, you ensure that your report data doesn't contain any duplicates.

Winston
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic