Get bigger!

Report a typo

You have a generic function getBigger(), which takes two arguments of the same type (a string, number, etc.) and should return the larger one. Not all types can be compared, though, and with some of them, you will get compilation problems. You need to complete the function according to the description above. Add a type bound so that your function can take only those types that implement interface Comparable<T>.

Write a program in Kotlin
// finish it!
fun <T> getBigger(a: T, b: T): T {

}
___

Create a free account to access the full topic