-  [JOIN IRC!]


[Return]
Posting mode: Reply
Name
Subject   (reply to 71)
Message
File
Password  (for post and file deletion)
¯\(°_O)/¯
  • Supported file types are: BMP, GIF, JPG, PNG
  • Maximum file size allowed is 10000 KB.
  • Images greater than 400x400 pixels will be thumbnailed.
  • Currently 317 unique user posts. View catalog

  • Blotter updated: 2015-09-02 Show/Hide Show All


File 132763917933.jpg - (48.09KB , 600x800 , Ai5t8g0CAAADlN3.jpg )
71 No. 71
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?
>> No. 72
I think that one well-written loop should solve yours problem.
>> No. 75
http://www.daniweb.com/software-development/java/threads/131256

This should help you alot


Delete post []
Password  
Report post
Reason