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 are null or not.

  • Since the == operator may have to access an actual object, determining whether a variable is null must be performed by the is operator.

  • !is is the opposite of is.

  • 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.