Is it correct to say that the parameters in the de...
# getting-started
f
Is it correct to say that the parameters in the default constuctors are not properties unless you don't define them as such? I. E. class Cippa ( a: Int, val b: String) b is a property but a is not. Also, when could it be useful to define parameters that are not properties? Hope the question's clear. Thanks everyone!
p
For example if property is already defined in super class:
Copy code
open class Base(val name: String)

class Child(name: String) : Base(name)
✔️ 1
or if you need to do a validation of parameters (but I would create a function in this case I think)
✔️ 1
And it is called primary constructor 🙂
f
Thanks. Where would you do the validation? In the init block or in a separate function? 🤔
a
Separate function aka factory function
1