thisclassconsistsofstaticutilitymethodsforoperatingonobjects。
oneofsuchmethodsisobjects.is null (。
myunderstandingisthatobjects.is null (wouldremovethechanceofaccidentallyassigninganullvaluetoobjectbyomitttingthesecond=.
However,the API Note states:
thismethodexiststobeusedasapredicate,filter(Objects3360:isnull ) )。
wouldtherebeanyreason/circumstanceforwhichishoulduseobject==nulloverobjects.is null (inanifstatement?
should objects.is null (beconfinedtopredicatesexclusively?
shoulduseobject==nulloverobjects.is null (inaifstatement?
ifyoulookatthesourcecodeofisnullmethod,
/* returnstrueiftheprovidedreferenceisnullotherwisereturnsfalse.* /
publicstaticbooleanisnull (objectobj ) {
返回obj==null;
}
itis the same.thereisnodifference.soyoucanuseitsafely。