for me, the collection class is one of the most powerful tools, especially for use in original programming. You may have sensed that I was somewhat disappointed with the collection provided by Java 1.1. So it's really nice to see that Java 1.2 has brought the correct attention back to the collection. this The collection of versions has also been completely redesigned (by Sun's Joshua B Loch). I think the new design collection is one of the two most important features of Java 1.2 (the other is the swing library, which will be described in the 13th chapter), because they greatly facilitate our programming and make Java a more mature programming system. Some designs make the integration of elements closer and easier to understand. For example, many names become shorter, clearer, and easier to use; Some of the names were modified to be more popular: The one I felt particularly good was the substitution of "enumerations" (enumeration) with "Iterators" (Iterator). The redesign also reinforces the function of the collection library. The new behaviors now include linked lists, queues, and undo teaming (the "double End Queue").
(1) Collection (Collection): A set of separate elements , usually with some kind of rule applied. Here, a list must hold elements in the order of a specific
(2) Mapping (MAP): A series of "key-value" Yes (this has been fully reflected in the hash table). From the surface, this seems to be
is a "collection" of "key-value" pairs, but if you try to implement it that way, you will find the implementation process rather clumsy. This further permits
Understanding should be separated into separate concepts. On the other hand, you can easily view a portion of a map. Just create a collection and then use it to table
Part of the show. In this way, the MAP can return a set of its own keys, a list containing its own values, or a "key
-a list of value pairs. Like arrays, maps can be easily extended to multiple "dimensions" without any new concepts involved. Simply place a
Map contains other maps (which can contain more maps, and so on).
New Java Collection