There is no static
keyword in Kotlin.
What is the best way to represent a static
Java method in Kotlin?
The kotlin documents provider three ways to do that, the first is define function in package,without class:
package com.example
fun f() = 1
the second is use @JvmStatic annotation:
package com.example
class A{
@JvmStatic
fun f() = 1
}
and the third is use companion object:
package com.example
clss A{
companion object{
fun f() = 1
}
}