parcel11.java
来自「think in java TIJ-3rd-edition-code.zip」· Java 代码 · 共 29 行
JAVA
29 行
//: c08:Parcel11.java
// Creating instances of inner classes.
import com.bruceeckel.simpletest.*;
public class Parcel11 {
class Contents {
private int i = 11;
public int value() { return i; }
}
class Destination {
private String label;
Destination(String whereTo) {
label = whereTo;
}
String readLabel() { return label; }
}
public static void main(String[] args) {
SimpleTest monitor =
new SimpleTest("Parcel11");
Parcel11 p = new Parcel11();
// Must use instance of outer class
// to create an instances of the inner class:
Parcel11.Contents c = p.new Contents();
Parcel11.Destination d =
p.new Destination("Tanzania");
monitor.expect(new String[] {
});
}
} ///:~
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?