I have a List with array of object values. I have to display value from the list of object.
List InvoiceList =[{companyname=greytip1, invoiceno=GO/12/04/001,
billperiod=Apr 2012, invoicedate=2012-04-18 00:00:00.0,
servicecharge=2000.00, tax=399.00, netamount=2394.00, duedate=null,
mailed=false, isinelekka=false, amountpaid=null, filename=Invoice For
Apr 2012-1333340688550.pdf, cid=15, ismanual=true},
companyname=greytip3, invoiceno=GO/12/04/002, billperiod=Apr 2012,
invoicedate=2012-04-05 00:00:00.0, servicecharge=5000.00, tax=500.00,
netamount=5498.00, duedate=null, mailed=false, isinelekka=false,
amountpaid=null, filename=Invoice For Apr 2012-1333340842337.pdf,
cid=16, ismanual=true}]
from this InvoiceList, I need to get netamount from each object and add it.
How to do it in java?
invoiceList[INDEX].PROPERTYNAME. For an example:invoiceList[0].ismanualwill return true. Basically you need to iterate with a for loop through the list and have a global variable in which you can store the sums.