5.1: Extensions

Question 1

Which one of the following returns a copy of a list?

Question 2

Which one of these extension functions on class AquariumPlant(val color: String, val size: Int, private val cost: Double, val leafy: Boolean) will give a compiler error?

Question 3

Which one of the following is not a place where you can define constants with const val?

Last updated