Array/list question

  • Thread starter Thread starter Kimmo Laine
  • Start date Start date
K

Kimmo Laine

Hello

i need two list that can be dynamically increased - one to store integers
and the other to store custom objects. I currently use ArrayList and it
works fine... Is there other choices? Is there a "IntList" or something -
when storing integers, ArrayList feels a little "heavy" to do this simple
task?


thx

Kimmo Laine
 
Kimmo Laine said:
i need two list that can be dynamically increased - one to store integers
and the other to store custom objects. I currently use ArrayList and it
works fine... Is there other choices? Is there a "IntList" or something -
when storing integers, ArrayList feels a little "heavy" to do this simple
task?

ArrayList will work, but will end up boxing each int, causing more
memory usage and a bit of extra CPU work. How large is the int list
going to be? Unless it's got thousands and thousands of elements, I'd
just stick with ArrayList, to be honest. (In C# 2.0 of course you could
use List<int>.)
 
Back
Top