Kotlin’s invoke Operator function
class ReleaseHandler {
operator fun invoke() {
print("invoke method called")
}
}
var release = ReleaseHandler()
Output: invoke method called
If you want to execute a function without specifying the function name then you can…