malik ge wrote:But if I don't know, how many values are there going to be in an array list, then how can I get them?
For example, if I am trying to get 3 values from an array list, but in that array list there are more than 3 values, then how to handle that situation?
That depends entirely on which 3 you want: The first 3? The last 3? 3 from the middle? 3 at random?
You need to be more specific.
Bats fly at night, 'cause they aren't we. And if we tried, we'd hit a tree -- Ogden Nash (or should've been).
Articles by Winston can be found here
Joined: May 13, 2011
Sorry for not being specific.
What I meant to say is that if array list's size is unknown. Meaning, I don't know if there are going to be 3 elements or 4 or more than that.