Summary
A summary of variable lifetimes, the null value, and the is operator is given in this lesson.
We'll cover the following
Summary
Let’s summarize this chapter:
-
null
is the value indicating that a variable does not provide access to any value. -
References that have the
null
value can only be used in two operations: assigning a value to them and determining whether they arenull
or not. -
Since the
==
operator may have to access an actual object, determining whether a variable isnull
must be performed by theis
operator. -
!is
is the opposite ofis
. -
Assigning
null
to a variable makes that variable provide access to nothing. -
Objects that are not referenced by any variable are finalized by the garbage collector.
Get hands-on with 1400+ tech skills courses.