2014-08-01 00:45:48 -07:00
|
|
|
import io;
|
|
|
|
|
|
|
|
|
|
typedef ClassWithConstructor {
|
|
|
|
|
|int| data;
|
|
|
|
|
|ClassWithConstructor*| construct(|int| inData) {
|
|
|
|
|
data = inData;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|void| printData() {
|
2014-12-30 01:22:09 -05:00
|
|
|
io::println(data);
|
2014-08-01 00:45:48 -07:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|int| main() {
|
|
|
|
|
|ClassWithConstructor| object.construct(4);
|
|
|
|
|
object.printData();
|
|
|
|
|
|int| a = 8;
|
2014-12-30 01:22:09 -05:00
|
|
|
io::println(a);
|
2014-08-01 00:45:48 -07:00
|
|
|
return 0;
|
|
|
|
|
}
|