If there is an instance of Java Collection which may carry primitive type, generic array, and/or iterable collection, I want to treat the generic array as Iterable collection, but how? e.g. the following pseudo java code
List<?> list1;
list1.add(new int[2]);
list1.add(new String[3]);
list1.add(new ArrayList());
for (Object e : list1){
if (e instanceof Iterable){
//The int[2] and String[3] will not fall in this case that I want it be
//Iterate within e
}
}
Please advise how to make the int[2] and String[3] fall in the case.
Thanks & regards, William