In a prior video, you learn about how to use a List to manage ordered data. In this video, learn how to use a class named HashMap to represent an unordered data collection. Just as with an ArrayList, which implements the list interface, a HashMap is an implementation of an interface named Map.
- [Instructor] I've previously described…how to use a list to manage ordered data.…The list was the interface, the contract…that defined a set of methods,…but I used a concrete class named array list…that kept the data in a particular order.…Now I'll show you how to use a class named…HashMap to represent an unordered data collection,…containing key value pairs.…Just as with an array list, which implements…the list interface, a HashMap is an implementation…of an interface named map.…
I'll start here in my empty main method,…and I'll declare an instance of the map interface.…Maps use generic declarations, just like lists,…but the items within a map are key value pairs.…Both the key and the associated value…can be of any class type.…So for example, if I want the keys to be strings,…I would pass in string as the first type,…and if I want the associated values to be strings,…I would pass that in again.…
I'll name my object map, and I'll instantiate it…with new HashMap, just like with lists…and array lists, the constructor method…
- Debugging Java code
- Handling exceptions
- Creating custom classes
- Working with inheritance
- Managing data collections
- Using Java packages and libraries
- Preparing a Java application for deployment
Skill Level Intermediate
1. Exception Handling and Debugging
2. Create Custom Classes
3. Work with Inheritance
4. Manage Data Collections
5. Use Java Packages and Libraries
Work with dates and times7m 12s
6. Prepare a Java Application for Deployment
Next steps1m 12s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.