posted 13 years ago
- Please avoid double/float where exact values are required. Replace float/double fields(or localvariables if any) with BigDecimal objects.
- Make all instance fields "Private"
As John said, in your getSummary() method, declare a variable called "totalAmount" which is of the type your method returns. you'll iterate through the list in anyway you like(enchance for loop, using Iterator, using listIterator, using traditional for loop) and as you iterate through the list, for each object, get the amount and add it to the totalAmount variable and return the totalAmount.