Method invocation
A method invocation is an operation that calls a method or callable operation, optionally with a receiver and arguments, causing its behavior to execute.
Kotlin in Action, 2E
The invoke method is a Kotlin function named invoke that enables instances of its containing type to be called with function-call syntax.
- How it is used
- Enables callable custom objects and flexible nested DSL syntax alongside ordinary method-call APIs.
- How deep it goes
- Explains call-syntax translation, overloads, FunctionN mechanics, nullable calls, reflection, and receiver-lambda DSL implementation.
- Examples
- Demonstrates a Greeter callable object, nullable transform callback, typed reflected sum function, and dependency-configuration DSL.
- What you can do after
- Build it from scratch by defining operator invoke methods that provide function-like calls or receiver-lambda DSL blocks.
Troubleshooting Java, Second Edition
A method invocation is an execution-time call to a method, including each occurrence of entering that method.
- How it is used
- Uses invocation counts during performance investigations to distinguish slow methods from methods that are called excessively.
- How deep it goes
- Measures execution counts through filtered profiling, stopping short of explaining method implementation internals.
- Examples
- Compares 1,000 calls taking 50 milliseconds each with one call causing five seconds of latency.
- What you can do after
- Diagnose performance by filtering profiler targets and interpreting invocation counts alongside execution time.
Read how Troubleshooting Java, Second Edition explains method invocation →
Related concepts
- thisuses · In JavaScript, the this value is determined by a function’s call context or, for an arrow function, inherited lexically.
- callkind of · A function call is an operation or expression that invokes a function or other callable, optionally supplies arguments, and initiates its execution.
- FunctionN interfacepart of · A FunctionN interface is a compiler-generated Kotlin interface representing a function value with a specific number of parameters and an invoke operation.
- object-oriented programminguses · Object-oriented programming is a programming paradigm that organizes software around objects combining state and behavior, commonly using encapsulation, classes, inheritance, or polymorphism.
- safe-call operatorused by · A safe-call operator conditionally accesses or invokes an operation through a nullable receiver, producing null when the receiver is null.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

