December 2015
Intermediate to advanced
298 pages
5h 30m
English
You always want to be able to concisely express yourself. Let's try the following command to create a string:
scala> val list = List("One", "two", "three", "Four", "five") list: List[String] = List(One, two, three, Four, five)
We have created a list of strings. Note that we neither had to specify the type of the list for this, nor any new keyword. We just expressed that we wanted a list assigned to a read-only variable.
Code reviews do a lot of good to a code base. I keep looking for places where I can replace a variable assignment with variable initialization. Refer to the following URL for an example: http://www.refactoring.com/catalog/replaceAssignmentWithInitialization.html.
Scala helps us with the val keyword. With the use ...
Read now
Unlock full access