String interpolation in kotlin

 package com.example.my_kotlin_practice


fun main(args: Array<String>)
{
var a:Int = 10
var b:Int = 22

println("Value of a is : $a")
println("Value of b is : $b")
println("Addition of $a and $b is : ${a+b}")
}

OUTPUT :

Value of a is : 10 Value of b is : 22 Addition of 10 and 22 is : 32 Process finished with exit code 0

Comments

Popular posts from this blog

Maps (Collections) in kotlin

Functions in Kotlin

Arrays in Kotlin