The system. Collections namespace contains interfaces and classes that define a set of objects (such as lists, queues, bit arrays, hash tables, and dictionaries.System. collections. the generic namespace contains interfaces and classes that define a
Considerations for using the set:
1,Objects can only be referenced in a set, and Native data types cannot be placed., We need to use native data type packaging classes to add them to the Set (jdk5 will automatically perform the packing and unpacking
First, ArrayList source analysis (JDK7)
ArrayList internal maintenance of a dynamic object array, ArrayList dynamic additions and deletions is to the group's dynamic additions and deletions.
1, ArrayList Construction and initialization
Turn from: http://www.cnblogs.com/hnrainll/archive/2013/04/08/3006638.html
The difference between the Set,list,map,vector,arraylist
The difference between the Set,list,map,vector,arraylist
Java Container---List,map,setCollection├list│├linkedlist│
Java Container---List,map,setCollection├list│├linkedlist│├arraylist│└vector│└stack└setMap├hashtable├hashmap└weakhashmapThe collection interface Collection is the most basic collection interface, and a collection represents a set of object, the
Arraylist and hashmap are asynchronous, while vector and hashtable are synchronous. Therefore, vector and hashtable are thread-safe, while arraylist and hashmap are not thread-safe.Because synchronization takes machine time, the execution efficiency
Differences and usages of Java ArrayList, vectors, and linkedlist (RPM)ArrayList and Vector is to take the array format to store data, this array element is larger than the actual data stored in order to grow and insert elements, both allow the
Differences and usages of Java ArrayList, vectors, and linkedlist (RPM)ArrayList and Vector is to take the array format to store data, this array element is larger than the actual data stored in order to grow and insert elements, both allow the
Second, array list--arraylist 1. Construction methodArrayList is a dynamic array in Java, and the underlying implementation is an array of objects, except that the capacity of the array changes depending on the situation.It has a constructor with
1. Fail-fast Introduction"Fast Fail" is fail-fast, which is an error detection mechanism for Java collections. When a thread iterates over collection, it does not allow other threads to make structural changes to the collection.For example, suppose
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.