检查数组中的空元素时出错

use*_*956 -2 java arrays

为什么我不能检查数组中的位置是否为空?我收到了错误的信息:

对于标记行上的参数类型int,null",运算符==未定义

private static int findNr(int[] trans)
{
    int emptyPlace=0;
    for (int i=0; i<trans.Length -1;i++)
    {
        --> if( trans[i] = null) <--
           return emptyPlace = trans[i];            
    }
    return emptyPlace;
}
Run Code Online (Sandbox Code Playgroud)

Mar*_*rry 6

您无法比较原始数据类型null.int是原始数据类型.