---
title: "Collection Set List HashSet TreeSet ArrayList LinkedList Map HashMap TreeMap"
author: "Menuz"
date: "2011-11-02T12:45:43Z"
tags: ["Collection", "Java", "Set", "map"]
categories: ["编程语言"]
slug: "collection-set-list-hashset-treeset-arraylist-linkedlist-map-hashmap-treemap"
draft: false
lastmod: "2011-11-02T12:48:33Z"
id: 1227004
url: "https://menuz.iteye.com/blog/1227004"
---

好久没有翻过书了，Set,List,Map的概念早已混淆的不行。这两天大量接触这些集合类，是该整理整理了。

图解：
    ![](http://move91-wordpress.stor.sinaapp.com/uploads/2011/10/o_umlList.jpg)

里面注释差不多可以解释基本情况了。
再提几点：

1.Collection没有get()方法，只能通过iterator遍历元素
2.Collection与Set拥有一样的接口
3.List有get()
4.Map中可以将key,value序列抽取出来,将key抽取出来为keySet，value抽取出来为Collection，知道为什么set而不是collection，这个方法名也就记住了。