<How to instantiate new Kotlin class> I'm learning...
# stackoverflow
u
How to instantiate new Kotlin class I'm learning Kotlin and I am struggling with classes. Lets say I have a class called player, we'll keep it simple: class Player (var name: String) What I want to do is have a button that when clicked will create a new player. I understand onClickListener etc for a button and I know to populate the class I can do something like: var playerOne = Player("John") what I don't understand is how to create a playerTwo or a second instance of the class Player on a button click. Obviously var...