Click here to Skip to main content
15,887,331 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
In Vb.Net I would do it in this way

VB
Dim p As New Person()
p.Name = ""
someFunc(p)

'OR

Dim p As New Person()
With p
   p.Name = ""
End With
someFunc(p)

'OR

someFunc(New Person() With {.Name = ""})


Now how to do the last in Kotlin?

What I have tried:

In Kotlin:
someFunc(Person()[Name: ""])
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900