Hi.
How can i use/import functions from other file, example:
prnt.kt
fun prnt(txt: String)
{
println(“$txt”)
}
Main.kt
fun main(args: Array) {
println(“Hello World!”)
// prnt.kt.prnt(“Another Hello World”)
}
Hi.
How can i use/import functions from other file, example:
prnt.kt
fun prnt(txt: String)
{
println(“$txt”)
}
Main.kt
fun main(args: Array) {
println(“Hello World!”)
// prnt.kt.prnt(“Another Hello World”)
}
If it is in the same package, then simply: prnt()
.
Ok, it works
But how about when a file (ex. prnt.kt) its on other folder?
import com.other.package.prnt