Assume there is fun next(prev: Int): Int. Implement fun Int.nextValue(): Int which returns the same value as the first function.
Computer scienceProgramming languagesKotlinObject-oriented programmingObject-oriented programming usage
Extension functions
Delegation
Report a typo
Write a program in Kotlin
//Do not fix code below
fun next(prev: Int): Int = prev * 1000 - 10
//write your 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.