i int = 0 f float = 0.0 b bool = false c char = '\0' s string = ""
Or:
i int = new int() f float = new float() b bool = new bool() c char = new char() s string = new string() a Array<object> = new Array<object>()
Or:
i int f float b bool c char s string a Array<object>
package MyLib class Point2D x float y float constructor(x float, y float) this.x = x this.y = y end end class App static main(args Array<string>) p1 Point2D(1.0, 0.0) p2 Point2D(0.0, 1.0) end end
A nullable variable without initialization has the default value null:
i int f float? b bool? c char? s string? a Array<object>?
Assign null later:
ni int? = 0 ns string? = "Hello" ni = null ns = null
Constructors
np1 Point2D? = new Point2D(1.0, 0.0) np2 Point2D?(0.0, 1.0) np1 = null np2 = null