Effective Java 2ed心得1
来源:互联网 发布:做组织结构图软件 编辑:程序博客网 时间:2024/06/06 17:44
第二条
第一次试验
public class NuFacts {private final int a;private final int b;private final int c;private final int d;public static class Builder{private final int a;private final int b;private int c = 0;private int d = 0;public Builder(int a, int b) {this.a = a;this.b = b;}public Builder getC(int c) {this.c = c;return this;}public Builder getD(int d) {this.d = d;return this;}public NuFacts build() {return new NuFacts(this);}}private NuFacts(Builder builder) {a = builder.a;b = builder.b;c = builder.c;d = builder.d;}}
public class Nu {private final int a = 0;public static void main(String args[]) {NuFacts nuFact1 = new NuFacts.Builder(100, 10).getC(1).getD(2).build();NuFacts nuFact2 = new NuFacts.Builder(100, 10).getC(1).build();}}
0 0
- Effective Java 2ed心得1
- [心得] Effective Java心得笔记
- Effective Java 阅读心得
- ed
- ed
- ed
- ED
- Effective C++ (3rd Ed) 读书笔记(一)Item 2: Prefer constS, enumS, and inlineS to #defineS
- Effective Java 中文版第二版的读书心得(一)
- Effective Java 中文版第二版的读书心得(二)
- 《Effective Java》(1~2)阅读笔记
- Effective Java 2
- Effective Java笔记 (2)
- Effective java读书笔记2
- Effective Java----2
- Effective Java 1
- Effective Java: Item 1
- Effective java读书笔记1
- 成员函数指针与高性能的C++委托
- HUST 1630 largest rectangle(思维题)
- springMVC+mybatis+dwr中如何使用dwr
- Ubuntu下R包XML的安装
- 一个MFC应用程序的生命周期
- Effective Java 2ed心得1
- Github最流行的10,000个Java项目使用的类库
- Java 正确的做字符串编码转换
- 表单实例
- CPU-bound(计算密集型) 和I/O bound(I/O密集型)
- Android布局管理器 - 详细解析布局实现 .
- java web项目中设置session超时的方式
- MFC 对话框编程要点
- C++并发实战12:线程安全的queue