- 
                Notifications
    
You must be signed in to change notification settings  - Fork 20
 
JavaCollection
        kcp edited this page Oct 13, 2020 
        ·
        2 revisions
      
    目录 start
目录 end|2020-04-27 23:42|
- 
Collection 接口
- List 接口
- ArrayList
 - LinkedList 也实现了Queue接口 双向链表实现
 - Vector
 
 - Set 接口 内容不允许重复
- SortedSet 接口 单值排序接口
- TreeSet
 
 
 - SortedSet 接口 单值排序接口
 - Queue 接口 队列接口
- PiorityQueue
 
 
 - List 接口
 - 
Map接口
- HashMap 无序, key不重复
 - HashTable 无序, key不重复
 - TreeMap 按key排序, key不重复
 - IdentityMap key可重复
 - WeakHashMap 弱引用Map集合
 
 
迭代器
HashMap 键能为null, HashTable则不可以, 而且HashTable是线程安全的(依靠 synchronized 关键字实现)
避免 ConcurrentModificationException
interface
包括的方法有:

List接口有众多实现, 最常用的 ArrayList LinkedList
stackoverflow: list add then unsupportedoperationexception
有时候会使用 Arrays.asList() 或者 Collections.singletonList() 来快速生成 List
但是 这两个生成的实例都是返回 AbstractList 的实现类, 其 add remove 方法是没有实现的, 如果调用了就会抛出异常
    public void add(int index, E element) {
        throw new UnsupportedOperationException();
    }这是因为, 这个类设计就是采用的定长数组来实现List, 所以不能对其中元素进行更改 类似的还有
Collections.emptyXxx()
- Set是无序的,但是StringRedisTemplate的对象操作返回的set竟然是有序的
- 因为有一个类是SortSet,顾名思义,所以是有序的,要继续多学习和使用Java原生的集合对象了
 
 
- 
【 Algorithm 】
 - 
【 Blog 】
 - 
【 C 】
 - 
【 Database 】
 - 
【 Distributed 】
 - 
【 FrontEnd 】
- 【 FrontEnd/Frame 】
 - 【 FrontEnd/Node 】
 - Font
 - Hexo
 - JavaScript
 - LearnPS
 - ResponseCode
 - SVG
 - ViewSolution
 - extjs学习笔记
 
 - 
【 Functional 】
 - 
【 Go 】
 - 
【 Groovy 】
 - 
【 Java 】
- 【 Java/AdvancedLearning 】
- 【 JavaBasic 】
 - 【 JavaCache 】
 - 【 JavaCollection 】
 - 【 JavaConcurrency 】
 - 【 JavaMap 】
 - Annotation
 - ClassFile
 - Collection
 - Concurrency
 - Deploy
 - Exception
 - ExtendsAndInterface
 - Generics
 - IO
 - JDBC
 - JDKAndJRE
 - JMX
 - JVM
 - Java11
 - Java7
 - Java8
 - JavaNetwork
 - JavaReleaseVersion
 - JavaWeb
 - JvmPerformance
 - MQ
 - MultipleLanguage
 - Proxy
 - Reflection
 - Serialize
 - SyntaxAndType
 - Thread
 - WebPerformance
 
 - 【 Java/Android 】
 - 【 Java/Ecosystem 】
 - 【 Java/MSA 】
 - 【 Java/Spring 】
 - 【 Java/TemplateEngine 】
 - 【 Java/Test 】
 - 【 Java/Tool 】
 - 【 Java/thread 】
 - AlibabaJavaStandard
 - DesignPattern
 - HashMap解析
 - Java-NIO
 - Java虚拟机
 - Log
 - MIS
 - Quartz
 - RESTful
 - WebSocket学习笔记
 - ZooKeeper学习笔记
 - android学习笔记
 
 - 【 Java/AdvancedLearning 】
 - 
【 Kotlin 】
 - 
【 Linux 】
- 【 Linux/Alpine 】
 - 【 Linux/Arch 】
 - 【 Linux/Base 】
 - 【 Linux/Centos 】
 - 【 Linux/Container 】
 - 【 Linux/Debian 】
 - 【 Linux/Tool 】
 - JavaDevInit
 - Linux系统学习
 
 - 
【 MyBlog 】
 - 
【 Python 】
- 【 Python/Tool 】
 - Python
 - PythonConcurrent
 - PythonGUI
 - PythonGame
 - PythonNet
 - PythonOffices
 - PythonWeb
 - Python基础
 - Python核心学习
 
 - 
【 Reactive 】
 - 
【 Rust 】
 - 
【 Scala 】
 - 
【 Script 】
 - 
【 Skills 】
- 【 Skills/Application 】
 - 【 Skills/CS 】
 - 【 Skills/Cache 】
 - 【 Skills/Councurrency 】
 - 【 Skills/DevOps 】
 - 【 Skills/Document 】
 - 【 Skills/Ecology 】
 - 【 Skills/Network 】
 - 【 Skills/Search 】
 - 【 Skills/SoftwareEngineering 】
 - 【 Skills/Spider 】
 - 【 Skills/Test 】
 - 【 Skills/Vcs 】
 - 【 Skills/Work 】
 - AppManual
 - CelebrityQuotes
 - Miscellaneous
 - Platform
 - Problem
 - Protobuf
 - RegularExpression
 - SoftwareDesignEngineer
 - Website
 
 - 
【 Windows 】