Skip to content

Instantly share code, notes, and snippets.

@KinoAR
Created Aug 31, 2021
Embed
What would you like to do?
An example of Struct Init usage within the Haxe programming language.
@:structInit class Person {
final name:String;
var age:Int = 30;
public function new(name:String, age:Int) {
this.name = name;
this.age = age;
}
public function greet()
trace( 'Hello, I\'m $name, and I\'m $age years old!');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment