fun main(args: Array<String>){
val x: Int = 5
val y: Int = 6
val greatVal = x greaterValue y // x.greatValue(y)
println(greatVal)
}
infix fun Int.greaterValue(other: Int): Int{ // Infix function and also Extension func
if (this > other)
return this
else
return other
}
/*
* 1. All infix functions are extension function
* But all extensiong function are not Infix
* 2. Infix functions just have one parameter
*/