object HelloWorld {
def main(args : Array[String]){
//String Creation
var greeting="hello world...!"
var greeting1 : String = "Hello Hari Taraka Prabhu!";
println(greeting)
println(greeting1)
println(greeting,greeting1)
println(s"$greeting\n$greeting1")
println(" ")
//length of the string
var lenstring = " welcome to scala programming"
var len=lenstring.length()
println("length of the string is:" + len)
println(" ")
//Concatenating Strings
val name="PRABHU_MANYAM"
val age=30
val job="Senior QA Engineer"
println("name of the employee is " + name + " and his age is " + age + " , his job is " + job)
println(s"my name is :$name\nage is:$age\njob is:$job")
println(" ")
}
}
Outout:
hello world...!
Hello Hari Taraka Prabhu!
(hello world...!,Hello Hari Taraka Prabhu!)
hello world...!
Hello Hari Taraka Prabhu!
length of the string is:29
name of the employee is PRABHU_MANYAM and his age is 30 , his job is Senior QA Engineer
my name is :PRABHU_MANYAM
age is:30
job is:Senior QA Engineer