aspose file tools*
The moose likes Beginning Java and the fly likes Trying to print contents of object filled array list. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Trying to print contents of object filled array list." Watch "Trying to print contents of object filled array list." New topic
Author

Trying to print contents of object filled array list.

Edward Strife
Greenhorn

Joined: Mar 15, 2012
Posts: 14
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

Joined: Mar 17, 2012
Posts: 892
    
    9
Something isn't right.


What happens when you try to compile/run the program?
Edward Strife
Greenhorn

Joined: Mar 15, 2012
Posts: 14
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

Joined: Mar 17, 2012
Posts: 892
    
    9
You should write a loop that goes through the values in your SortedList
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7779
    
  21

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


Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trying to print contents of object filled array list.