class bowl {
bowl(int marker) {
system.out.println("bowl(" + marker + ")");
}
void f1() {
system.out.println("ok");
}
}
class cupboard {
bowl b1 = new bowl(1);
static bowl b2 = new bowl(2);
cupboard() {
system.out.println("cupboard()");
}
static bowl b3 = new bowl(3);
}
class table {
table() {
system.out.println("table()");
}
table(string a,int i){
this();
system.out.println("ok");
}
}
public class order {
static cupboard t1 = new cupboard();
static table t2;
bowl t3 = new bowl(10);
void print() {
t3.f1();
}
public static void main(string[] args) {
system.out.println("creating new cupboard() in main");
new cupboard();
system.out.println("creating new cupboard() in main");
order od = new order();
od.t3.f1();
table t4 = new table("aa",1);
}
}
程序
闽公网安备 35060202000074号