HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
The println() function is used to output values/print text
The println()
function is used to output values/print text:
fun main() {
println("Hello World")
}
You can add as many println()
functions as you want. Note that it will add a new line for each function:
fun main() {
println("Hello World!")
println("I am learning Kotlin.")
println("It is awesome!")
}
You can also print numbers, and perform mathematical calculations:
fun main() {
println(3 + 3)
}
There is also a print()
function, which is similar to println()
. The only difference is that it does not insert a new line at the end of the output:
fun main() {
print("Hello World! ")
print("I am learning Kotlin. ")
print("It is awesome!")
}
Note that we have added a space character to create a space between the sentences.