源码分析
婉琪
上海融链科技有限公司
展开
-
java transient关键字作用,使用场景。
transient的作用及使用方法,官方解释为:Variables may be marked transient to indicate that they are not part of the persistent state of an object.我们都知道一个对象只要实现了Serilizable接口,这个对象就可以被序列化,java的这种序列化模式为开发者原创 2016-08-31 15:31:10 · 8092 阅读 · 0 评论 -
java ArrayList 的实现原理
1.ArrayList这是我们经常使用到的类,但是对于他是怎么实现的?我们来看一下: /** * Constructs a new instance of {@code ArrayList} with the specified * initial capacity. * * @param capacity * th原创 2016-08-31 15:55:15 · 259 阅读 · 0 评论 -
Java LinkedList 实现原理
LinkedList 大家都不陌生,来看看他的实现原理,首先声明,他是一个双链条,即previous,next /** * Constructs a new empty instance of {@code LinkedList}. */ public LinkedList() { voidLink = new Link(null, null,原创 2016-08-31 16:19:09 · 1303 阅读 · 0 评论 -
java List 线程安全
我们常用的ArrayList,LinkedList都不是线程安全的的List,为什么这么说: /** * A counter for changes to the list. */ protected transient int modCount;这是他们的父类 AbstractList 中的属性,含义就是用来标记当前修改次数,用于在遍历数据时保证数据的一致性原创 2016-09-02 10:18:45 · 7761 阅读 · 0 评论 -
android Handler机制的学习
我们经常这样创建handler,和使用Handler,Handler handler = new Handler(){ @Override public void handleMessage(Message msg) { super.handleMessage(msg); }};handler.sendEmptyMessage(0);但是有的时候翻译 2016-08-25 14:52:33 · 248 阅读 · 0 评论 -
java HashMap 实现原理
HashMap 我们不陌生,他是允许存放NULL 对象的,他的结构其实就是一个数组,不过稍微复杂一点:把这个图画出来,起始就很好理解了,首先我们来看一下他的构造方法: /** * Constructs a new empty {@code HashMap} instance. */ @SuppressWarnings("unchecked")原创 2016-09-05 18:52:03 · 320 阅读 · 0 评论 -
java volatile 关键字的含义和作用
转载 http://www.cnblogs.com/dolphin0520/p/3920373.html 写的不错这里我们主要来区别几个关键字:Volatile,const, synchronized1.const 声明常量定义的时候使用,是保证这个值不被修改的修饰符。2.synchronized 这个关键适用于多进程中,保证线程安全的,确保操作的原子性。3.Volatile 这个转载 2016-09-27 11:00:36 · 466 阅读 · 0 评论