Kotlin how does the inbuilt println function look like?

Viewed 32

I've been just wondering, is there a way to check how does the kotlin inbuild functions look like? (for example println()). As far as i know the inbuilt functions like println come to us ready-to-use, but they had to be written somehow. Can i see the source code of the entire function?

1 Answers

You can see source code of Kotlin functions in docs.

println() source code:

@kotlin.internal.InlineOnly
public inline fun println(message: CharArray) {
    System.out.println(message)
}

println() docs (Click "JVM Source" under function's name)

P.S. Ctrl+Click in code does not always display the logic of the source code.

Related