C# style object initialiser

There’s the apply method:

val emp_001 = Employee().apply {
    age = 25
    name = "Javed Khan"
}
1 Like