3.7 Using References, Diversity, Identity, and Equality
In Java, null is an incredibly special reference that can trigger a large number of problems. But you can’t do without it, and the following section will demonstrate its importance. After this discussion, we’ll look at how object comparisons work and the difference between identity and equivalence.
3.7.1 null References and the Question of Philosophy
In Java, three special references exist: null, this, and super. (We’ll defer descriptions of this and super to Chapter 6, Section 6.1.4.) The special literal null can be used to initialize reference variables. The null reference is typeless and thus can be assigned to any reference variable and passed to any method that awaits an object. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access