Professional Documents
Culture Documents
Chuong5 2
Chuong5 2
5.0 Dn nhp
A(int i) { this.i = i; }
}
C = new C(true); //A()->B()->C(true)
class B : A {
private double d;
B() { this.d = 0; }
B(double d) : base () { this.d = d; }
}
class C : B {
private bool b;
C() : base(3.1416) { this.b = false; }
C(bool b) { this.b = b; }
}
Khoa Khoa hc & K thut My tnh
Trng H Bch Khoa Tp.HCM
2010
C c = new C();
C = new C(true);
//C#
for (;;) {
obj = new C();
//x l obj
}
5.7 Kt chng