Hola!!


This site is built using hugo and the theme is built by Fredrik if you enjoy it, it is available at github


Extension And Infix

I wrote a sample of the extension and the infix in Kotlin. What is the infix. Infix ia a infix notation and You can use the infix notation.

Extension

>>> fun Int.sameAge(a:Int): Boolean { return this == a }
>>> 10.sameAge(10)
true
>>> 10.sameAge(12)
false

Infix and Extension

>>> infix fun Int.sameAge(a:Int): Boolean { return this == a}
>>> 10 sameAge 10
true
>>> 10 sameAge 12
false