Are default arguments shared between instances? E.g. in a data class like
data class Foo(val foo: List<String> = mutableListOf())
?
✅ 1
🚫 4
t
Ties
02/27/2023, 8:15 AM
No, they are basically the same as telescoping constructors would be in Java
class Foo{
public Foo() {
this(new ArrayList());
}
public Foo(List foo){
...
}
}