Java: How to check if object is null?

前端 未结 9 1401
甜味超标
甜味超标 2021-01-30 08:11

I am creating an application which retrieves images from the web. In case the image cannot be retrieved another local image should be used.

While trying to execute the f

9条回答
  •  悲&欢浪女
    2021-01-30 08:23

    if (yourObject instanceof yourClassName) will evaluate to false if yourObject is null.

提交回复
热议问题