Hey /nerd/, I need your help with Java. I'm working on a program that creates a table of objects (right now it's only needs to take in strings and numbers), and one of the functions takes all of the values in a column and, if they are numbers, finds their sum. Since this is supposed to be an API and expanded on later, I've decided to implement it as a two-dimensional ArrayList that takes in a generic. However, I'm not sure how to find the sum of the values. My question is: Is there a way to pull this off with generics, or should I just make the table out of a 2D array of strings and scrap the ArrayList idea?
I think that one well-written loop should solve yours problem.
http://www.daniweb.com/software-development/java/threads/131256 This should help you alot