Ellen Spertus
10/11/2022, 1:35 AMephemient
10/11/2022, 2:59 AMval textToPrint: List<String>
get() = text
val textToPrint: List<String>
get() = text.toList()
explicit cast might be between types that fail at runtime. implicit cast (as in 1) is always something that can succeed, according to the type system. or creating a defensive copy (as in 2) prevents the caller from casting back to mutable and gaining inappropriate access to your private dataephemient
10/11/2022, 3:00 AM