21 lines
357 B
Plaintext
21 lines
357 B
Plaintext
|
|
import io;
|
||
|
|
|
||
|
|
typedef ClassWithConstructor {
|
||
|
|
|int| data;
|
||
|
|
|ClassWithConstructor*| construct(|int| inData) {
|
||
|
|
data = inData;
|
||
|
|
return this;
|
||
|
|
}
|
||
|
|
|void| printData() {
|
||
|
|
println(data);
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
|int| main() {
|
||
|
|
|ClassWithConstructor| object.construct(4);
|
||
|
|
object.printData();
|
||
|
|
|int| a = 8;
|
||
|
|
println(a);
|
||
|
|
return 0;
|
||
|
|
}
|