Scala - Using String interpolation to print a variable Code Example

The code for Using String interpolation to print a variable

println("Using String interpolation to print a variable")
val mobileModel: String = "iPhone 13 Pro Max"
println(s"My personal mobile is $mobileModel")

/*
Output:
Using String interpolation to print a variable
My personal mobile is iPhone 13 Pro Max
*/
Code by IncludeHelp, on August 8, 2022 03:06

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.