When the 'Airplane' class is instantiated, it displays 'Aircraft = null', not 'Aircraft = C130' why?kotlinabstract class Aircraft { init { println('Aircraft = ${getName()}') } abstract fun getName(): String}class Airplane(private val name: String) : Aircraft() { override fun getName(): String = name}

🎲 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.


When the 'Airplane' class is instantiated, it displays 'Aircraft = null', not 'Aircraft = C130' why?<br>kotlin<br>abstract class Aircraft {<br> init { println('Aircraft = ${getName()}') }<br> abstract fun getName(): String<br>}<br>class Airplane(private val name: String) : Aircraft() {<br> override fun getName(): String = name<br>}<br>