Kotlin, Android App Development.
but instead of writing the speaking logic again, you can delegate it to another class, say GoogleAssistant: class GoogleAssistant : Speaker { override fun speak(message: String) { println("Google Assistant: $message") } } Now, in your AndroidPhone class, you can use interface delegation: class