Kishor Joshi wrote:If I use arraysize like 2000 I am getting all number starting from 0 to 1999
why?
Erm...because that's what you've coded?
Arrays have a fixed size - which you appear to have
redundantly assigned to
arraySize - and a generic "print" method can't possibly know what
portion of that array contains the things you want to display
unless you tell it.
A
List, on the other hand, contains only as many elements as you've supplied to it, so it will only print out that many.
So maybe the answer is to use a
List, rather than an array.
Winston