The fun keyword is used to declare a function. … The println() function is used to output/print text, and in our example it will output “Hello World”. Good To Know: In Kotlin, code statements do not have to end with a semicolon ( ; ) (which is often required for other programming languages, such as Java, C++, C#, etc.).