Hard
class Person(val name: String) {
var children: MutableList<Person> = mutableListOf<Person>()
}
I want to add a secondary constructor taking in addition to the name, a parent as a parameter, for this I must write:
Author: W3D TeamStatus: PublishedQuestion passed 613 times
Edit
1
Community EvaluationsNo one has reviewed this question yet, be the first!
2
Write a Kotlin code that prints 7 to the console.6
Write a function that returns the maximum of two integers in Kotlin4
Create a data class with a vip property implementing the Human interface2
In Kotlin, adding an element to a list does not change the list.10
How to flatten a list of lists in Kotlin3
Write a Kotlin program that evaluates an arithmetic expression.5
Kotlin: Compile the following code and see the error.