Hi, I am using an array to that represent a table in memory:
col1 col2 col3 col4
5 5 10
15 18 23
The app does not know the sie of the array on each execution so I set it to a large size, liek 1000 by 1000(1000 rows thousand columns). Of course it is inneficient as my table might only end up with 10 rows 10 colums and at the end of the program i iterate through 1000.
How can i replace that multi-dim array with ArrayList or another dynamic structure that gorws as u add values to colums and rows?
As far as I understand ArrayList is more of a single-dimension arraym basically array of objects, which only has one row(so hence 1 dimension).
Thanks
col1 col2 col3 col4
5 5 10
15 18 23
The app does not know the sie of the array on each execution so I set it to a large size, liek 1000 by 1000(1000 rows thousand columns). Of course it is inneficient as my table might only end up with 10 rows 10 colums and at the end of the program i iterate through 1000.
How can i replace that multi-dim array with ArrayList or another dynamic structure that gorws as u add values to colums and rows?
As far as I understand ArrayList is more of a single-dimension arraym basically array of objects, which only has one row(so hence 1 dimension).
Thanks