java常见类简单分析

HashMap最大,初始化容量,扩展因子

Entry[] table; ->Map.Entry<K,V>

int size;

Hashtable //实现继承字典抽象类,现在实现Map的接口

        //synchronized方法(size(),get(),set(),equals()等来实现同步)

 

 

ConcurrentHashMap ConcurrentHashMap分片段上锁,hashtable实现了同步

 

 

ArrayList /容器是对象数组object[]

List list = Collections.synchronizedList(new ArrayList(...))

 

LinkedList  Entry<E>

Entry(E element, Entry<E> next, Entry<E> previous) {

    this.element = element;

    this.next = next;

    this.previous = previous;

}  

Collections.synchronizedList(llist);

Collections.synchronizedMap(map);

 

 

Vector实现了synchronized方法

 

Set s=Collections.synchronizedSet(new HashSet());//通过wrap方法实现同步

HashMap<E,Object> map;

 

 

ThreadLocal->ThreadLocalMap->Thread

ThreadLocalMap is a customized hash map suitable only for

 maintaining thread local values.

Threadlocal

 

 

String

 

private final char value[];

 

    /** The offset is the first index of the storage that is used. */

    private final int offset;

 

    /** The count is the number of characters in the String. */

private final int count;

所以string是不可变的


转载于:https://my.oschina.net/iioschina/blog/670584

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值