Extension Functions and Object Declarations
Learn how to define extension functions on object declarations, companion objects, and inside classes.
We'll cover the following...
We'll cover the following...
Extension functions on object declarations
We can define extensions on object declarations.
Kotlin 1.5
object Afun A.foo() {print("\n Hi")}fun main() {A.foo()val a: A = Aa.foo()}