Import 'fun' from other file

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 :slight_smile:
But how about when a file (ex. prnt.kt) its on other folder?

import com.other.package.prnt
1 Like