Skip to main content

The Dictionary, Hashtable, and Properties Classes

  • Chapter
  • 805 Accesses

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

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   34.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   49.95
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Authors

Rights and permissions

Reprints 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

Publish with us

Policies and ethics