If suppose I add an object in ArrayList :
Ex : If Obj is my object having variables an int,
string and String[].
Obj ob = new Obj(1,"xyz", str[]);
List list = new ArrayList();
list.add(ob);
Now while fetching back the contents of arrayList I'm getting str[] as a second element , where it has to be part of first element.
String[] results;
results = (String[]) list.get(1);
results[1] --> 1,"xyz"
results[2] --> str[]
How do I avoid this? So that I get results[1] --> 1,"xyz",str[]