如何检查给我的对象是否是Java中的int []?

4 java

如何检查提供给我的对象是否是int[]Java中的?

Mic*_*ers 22

你期望的方式:

if (theObject instanceof int[]) {
    // use it!
}
Run Code Online (Sandbox Code Playgroud)

数组是Objects,即使它们是基本类型数组.