July 2018
Intermediate to advanced
242 pages
8h 6m
English
We can declare extension functions and extension properties inside any file in the project. However, to keep them well organized, it's better to put them in dedicated files.
The syntax for extension functions is very similar to the one of the standard function. We just need to add information about the type that is being extended with the new function, as follows:
fun SomeClass.newFunctionName(args): ReturnType { // body}
Read now
Unlock full access