SYSC 2100 Lecture 5: Linked Lists
Document Summary
Data must be shifted during insertions and deletions. Is able to grow in size as needed. Does not require shifting of items during insertions and deletions. As a data field of a class has a default value of null. A reference variable local to a method does not have a default value (compiler error) When one reference variable is assigned to another reference variable, both references then refer to the same object. An object that is no longer accessible through any reference variable is marked for garbage collection. An array of objects is actually an array of references to the objects. == and != compares the values of the reference variable, not the objects that they reference. Redefine equals method compares objects field by field. When an object is passed to a method as an argument, the reference to the object is copied as a formal parameter. Reference - based adt implementations and data structures use java references.