Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

5.2 Literals > 5.2 Literals - Pg. 74

C HAPTER 5 · Basic Types and Operations Table 5.1 · Some basic types Value type Byte Short Int Long Char String Float Double Boolean Range 8-bit signed two's complement integer (-2 7 to 2 7 - 1, inclusive) 16-bit signed two's complement integer (-2 15 to 2 15 - 1, inclusive) 32-bit signed two's complement integer (-2 31 to 2 31 - 1, inclusive) 64-bit signed two's complement integer (-2 63 to 2 63 - 1, inclusive) 16-bit unsigned Unicode character (0 to 2 16 - 1, inclusive) a sequence of Char s 32-bit IEEE 754 single-precision float 64-bit IEEE 754 double-precision float true or false name of Int is scala.Int . However, given that all the members of package scala and java.lang are automatically imported into every Scala source file, you can just use the simple names (i.e., names like Boolean , Char , or String ) everywhere. Savvy Java developers will note that Scala's basic types have the exact same ranges as the corresponding types in Java. This enables the Scala com-