Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Often, a new object is initialized with a literal value, such as val book = "Programming Scala". Let’s discuss the kinds of literal values supported by Scala. Here, we’ll limit ourselves to lexical syntax literals. We’ll cover literal syntax for functions (used as values, not member methods), tuples, and certain types like Lists and Maps as we come to them.
Integer literals can be expressed in decimal, hexadecimal, or octal. The details are summarized in Table 2-1.