There is no static keyword in Kotlin.
What is the best way to represent a static Java method in Kotlin?
I would like to add something to above answers.
Yes, you can define functions in source code files(outside class). But it is better if you define static functions inside class using Companion Object because you can add more static functions by leveraging the Kotlin Extensions.
class MyClass {
companion object {
//define static functions here
}
}
//Adding new static function
fun MyClass.Companion.newStaticFunction() {
// ...
}
And you can call above defined function as you will call any function inside Companion Object.