July 2017
Intermediate to advanced
796 pages
18h 55m
English
As mentioned, Scala is a JVM language, so it shares lots in common with Java. One of these commonalities is the data types; Scala shares the same data types with Java. In short, Scala has all the same data types as Java, with the same memory footprint and precision. As mentioned in Chapter 1, Introduction to Scala, objects are almost everywhere in Scala. and all data types are objects and you can call methods in them as follows:
|
Sr.No |
Data Type and Description |
|
1 |
Byte: 8 bit signed value. Ranges from -128 to 127 |
|
2 |
Short: 16 bit signed value. Ranges -32768 to 32767 |
|
3 |
Int: 32 bit signed value. Ranges -2147483648 to 2147483647 |
|
4 |
Long: 64 bit signed value. -9223372036854775808 to 9223372036854775807 ... |
Read now
Unlock full access