Class BB inherits from class AA. BB uses a different method to calculate the price. As shown, the code does not compile. What changes is needed to resolve the compilation error?kotlinopen class AA() { var price: Int = 0 get() = field + 10}class BB() : AA() { var price: Int = 0 get() = field + 20}

🎲 Try a Random Question  |  Total Questions in Quiz: 83  |  🧠 Study this quiz with Flashcards
This question is part of a full practice quiz:
Kotlin Quiz — practice the complete quiz, review flashcards, or try a random question.

Kotlin MCQs For LinkedIn Skill Assessments.


Class BB inherits from class AA. BB uses a different method to calculate the price. As shown, the code does not compile. What changes is needed to resolve the compilation error?<br>kotlin<br>open class AA() {<br> var price: Int = 0<br> get() = field + 10<br>}<br>class BB() : AA() {<br> var price: Int = 0<br> get() = field + 20<br>}<br>