Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Suppose I have an Arraylist called MyArray which contains 3 counts.

In Debug View,
MyArray|count=3
[0] | "value"
[1] | Count=12
[2] | 1

For this type of arraylist It is OK for like this:
ArrayList fromlist = (ArrayList)((ArrayList)MyArray)[2];

And I will get 1.
But in this following Arraylist how can I get?
MyArray|count=3
+ [0] | something.ReturnObjectClass
+ [0] | something.ReturnObjectClass
+ [0] | something.ReturnObjectClass

The data is contained and will find if you Click plus(+) .
My Question is how to get data from Arraylist which shows Return---ObjectClass instead of it data.
Thanks.
Posted
Updated 3-Oct-13 3:09am
v3

1 solution

No. MyArray[2] is a number - 1 - not an ArrayList. MyArray[1] would seem to be an arraylist...

Just a suggestion, but it you are returning or otherwise passing multiple values around with an ArrayList it would probably be a good idea to create specific class to hold the three values and access they via properties - then you don't have to cast them at all, and it is impossible to use the wrong element!
 
Share this answer
 
Comments
[no name] 3-Oct-13 10:54am    
ႊThanks for your answer.
I mean I can get First Arrarylist data. 1 is my false to show as an example.
My problem is how to get Arraylist data of second Arraylist.
OriginalGriff 3-Oct-13 11:07am    
Sorry?
It may be that I'm confused, but that makes no sense to me at all.
Would you mind giving a bit more information on exactly what you are trying to do?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900