Inside the Friend class, declare a method called greeting() that should be available only in the Friend class and its subclasses. The function takes a parameter name as a string and returns "Hello $name".
Computer scienceProgramming languagesKotlinObject-oriented programmingObject-oriented programming basic
Visibility modifiers for members
Protected Method
Report a typo
Write a program in Kotlin
open class Friend {
// Write code here
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.