How can I know the instance of java.util.Arrays$ArrayList
. I've tried this code snippet but it does not work at all :
if (myList instanceof Arrays) {
//Do something here.
}
I have compared the object classtype with ArrayList and I had the same issue. But while I was inspecting the object, the classType was a :
class java.util.Arrays$ArrayList
The conditional statement below was the only solution I found:
else if (myList.getClass().toString().equals("class java.util.Arrays$ArrayList")) {
//do something here
}
but I think that controlling the object type by using instanceof would be a great solution.
My question is : what is the classType of java.util.Arrays$ArrayList
, so I can use instanceof for my control.
Thanks in advance,
Omar.