January 2018
Intermediate to advanced
434 pages
14h 1m
English
One of the use cases of static methods is that we can prevent multiple copying of the same methods in different classes, and also that we don't need to create an object of the enclosing class.
Kotlin recommends creating package-level functions. If you are coming from the Java world, this probably won't make any sense to you as this isn't supported in Java. Let's see how it's done in Kotlin:
package packageAfun foo(){ println("calling from boo method")}
Read now
Unlock full access