I want to know if it's possible to define a class with some sort of constructor or if I have to initialize every field by hand.
Constructors in wollok are defined using the 'constructor' keyword. For example:
class Point {
var x
var y
constructor(_x, _y) {
x = _x
y = _y
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With