Problem Statement
What are extension functions in Kotlin?
Explanation
Extension functions allow you to add new functions to existing classes without modifying their source code or using inheritance, defined with the class name followed by dot before the function name. You can extend any class including final classes or classes from libraries, and the function can be called as if it were a member of that class.
Extension functions are resolved statically at compile time based on the declared type, not the runtime type, and they cannot access private members of the class they extend. This feature is one of Kotlin's most powerful capabilities for writing expressive and readable code while keeping classes clean.
