|
|
Summary
This chapter is really about distinctions between concepts and words that are very closely related.
- ! You learn what Java objects really are: chunks of memory in the heap. You also learn that Java uses references to locate those areas of memory in the heap and that all access to objects takes place through references. You learn how a reference to an object differs from the object itself.
- ! There is a class for objects (java.lang.Object), and classes are themselves objects of type java.lang.Class. A little-c class is not quite the same thing as a capital-C Class, nor is a little o-object quite the same thing as a capital-O Object. You learn about the methods of the java.lang.Object class and how you use and override those in classes you write.
- ! You learn that Strings are immutable arrays of Unicode characters. You also learn that StringBuffers are growable arrays of Unicode characters and that behind the scenes, many String operations are performed with StringBuffers.
- ! One-dimensional arrays of primitive data types are contiguous blocks of memory containing primitive values. However, one-dimensional arrays of reference data types contain only references to objects that live elsewhere in the heap; Multidimensional arrays are arrays of arrays, and all arrays implicitly subclass java.lang.Object.
- ! Finally, you learn about the internal structure of several common Java container classes: Vector, Stack, and Bitset. By understanding how these classes operate, you can now make intelligent decisions about when and whether these classes are appropriate for your needs and when you should rewrite or replace them with classes of your own devising.
|