Abstract
In this chapter, we’ll look at the historical collection classes that offer support to store key-value pairs. Unlike the Vector class where you look up values based upon an integer index, the Dictionary class and its subclasses work with key-value pairs, where an object is the key to look up a value that is also an object. For the most commonly used subclass, Hashtable, both the key and value can be of type Object or any of its subclasses. The Properties class is another implementation. Instead of working with any type of object, the key and value must both be of type String. Figure 5–1 shows a diagram of the hierarchy of these three classes.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
Rights and permissions
Copyright information
© 2001 John Zukowski
About this chapter
Cite this chapter
Zukowski, J. (2001). The Dictionary, Hashtable, and Properties Classes. In: Java™ Collections. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-0854-9_5
Download citation
DOI: https://doi.org/10.1007/978-1-4302-0854-9_5
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-893115-92-7
Online ISBN: 978-1-4302-0854-9
eBook Packages: Springer Book Archive