Get the class of java.util.Arrays$ArrayList

前端 未结 3 1049
南方客
南方客 2021-01-26 16:49

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)         


        
3条回答
  •  粉色の甜心
    2021-01-26 17:04

    Why are you using Arrays ? You must use ArrayList like in this code

    if (myList instanceof ArrayList) {
        //Do something here.
    }
    

提交回复
热议问题