I have below code but when i remove case statement , object instance(Donut) cannot able to refer . I want to understand with simple example with class and case class statements , Please advise . Also i want to understand why '(' ')' is printed in my second print statement.
case class Donut(name: String, tasteLevel: String)
val favoriteDonut2: Donut = Donut("Glazed Donut", "Very Tasty")
println(s"My favorite donut name = ${favoriteDonut2.name},
tasteLevel = ${favoriteDonut2.tasteLevel}")
println( s"My fav donut name is = ${favoriteDonut2.name}",
s"taste level is = ${favoriteDonut2.tasteLevel}")
output:-
My favorite donut name = Glazed Donut, tasteLevel = Very Tasty
(My fav donut name is = Glazed Donut,taste level is = Very Tasty)