Hey,
You can use below code to access variables using s string interpolation:
scala> val title = "Play"
title1: String = Play
scala> val title2 = "Scala"
title2: String = Scala
scala>val book1 = "Book($title1 2 for $title2)"
book1: String = Book($title1 2 for $title2)
scala>val book2 = s"Book($title1 2 for $title2)"
book2: String = Book(Play 2 for Scala)
If you want to know more about Apache Spark Scala, It's highly recommended to go for the Apache Spark Certification today.