Java (6) collection

1、 Overview of Java collection framework

1. What is a collection

2. Characteristics of sets

3. System of sets

explain:

explain:

2、 Methods in the collection interface (15)

1. Explain

2. 15 methods

matters needing attention:

3. Iterator iterator interface

//用集合中的iterator方法得到迭代器对象
Iterator iterator = coll.iterator();
//遍历集合
while(iterator.hasNext()){
    System.out.println(iterator.next());
}

//当然我们也可以用foreach来遍历,其实foreach本质也是调用了迭代器。
while (coll.iterator().hasNext()){
    System.out.println(coll.iterator().next());
}

3、 List interface

1. List Interface Overview

2. Similarities and differences of ArrayList, LinkedList and vector (interview questions)

3. Source code analysis (bonus item)

4. List common methods

4、 Set interface

1. Set Interface Overview

2. Similarities and differences of HashSet, linkedhashset and TreeSet

3. Understand disorder and repeatability

4. The process of adding elements (taking HashSet as an example)

5. Override hashcode () and equals () methods

6. Interview questions

5、 Map interface

1. Map interface overview

2. Interview questions

3. Understanding of map structure

4、 Underlying implementation principle of HashMap ★★★★★★ (high frequency interview questions)

1、JDK7

2. Differences between jdk8 and JDK7

3. Underlying implementation principle of LinkedHashMap

static class Entry<K,V> extends HashMap.Node<K,V> {
    Entry<K,V> before,after;//能够记录添加的元素的先后顺序
    Entry(int hash,K key,V value,Node<K,V> next) {
        super(hash,key,value,next);
    }
}

6、 Common methods of map interface

1. Add, delete and modify:

2. Operation of element query:

3. Method of metaview operation:

4. Summarize common methods:

7、 Properties

1、@R_ 301_ 1970@

8、 Collections tool class

1. Collections overview

2. Collections common methods

Sort operation

Query and replace

3. Differences between collections and collections (interview questions)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>