Java - 是`null`是`object`的一个实例? [英] Java - is `null` an instance of `object`?
本文介绍了Java - 是`null`是`object`的一个实例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我读到 null
不是 instanceof
任何东西,但另一方面一切在Java中扩展对象
类。
I read that null
isn't an instanceof
anything, but on the other hand that everything in Java extends Object
class.
推荐答案
不,它是参考
。 null不是对象
No, it is a reference
. null is not an object
String s = null;
System.out.println(s instanceof Object); // false
这篇关于Java - 是`null`是`object`的一个实例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文