Scala, Design Patterns, Programming, Builder Pattern, Coding.
Book("The Hobbit", "J.R.R. Tolkien", 10.5) System.out.println(s"The book ${book.title} written by ${book.author} got a price of ${book.price} euros") } As it can be observed, a more extensible code with less boilerplate it’s achieved. Also the book it’s immutable. The instance is constructed with