摘要: Builder pattern vs Constructor vs Setter You could have built an object with this: // Example 1 new FlyingMachine("Boeing 787", 2, false); Or this: // 阅读全文
posted @ 2019-02-12 20:37 okay4321 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 共享锁:又称为读锁,简称S锁,顾名思义,共享锁就是多个事务对于同一数据可以共享一把锁,都能访问到数据,但是只能读不能修改。 排他锁:又称为写锁,简称X锁,顾名思义,排他锁就是不能与其他锁并存,如一个事务获取了一个数据行的排他锁,其他事务就不能再获取该行的其他锁,包括共享锁和排他锁,但是获取排他锁的事 阅读全文
posted @ 2019-02-12 20:10 okay4321 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Each object is associated with a monitor. A monitor is locked if and only if it has an owner. The thread that executes monitorenter attempts to gain o 阅读全文
posted @ 2019-02-12 15:43 okay4321 阅读(591) 评论(0) 推荐(0) 编辑
摘要: 调用方式: 静态内部类:OuterClass.StaticInerCls staticInerCls = new OuterClass.StaticInerCls(); 非静态内部类:OuterCls outerCls = new OuterCls();OuterCls.InerCls inerCl 阅读全文
posted @ 2019-02-12 15:24 okay4321 阅读(110) 评论(0) 推荐(0) 编辑