Home > Back-end >  Kotlin how does the inbuilt println function look like?
Kotlin how does the inbuilt println function look like?

Time:09-13

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?

CodePudding user response:

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