Basic Data Types in Scala
Data Types in Scala
There are 9 types of Basic Data Types in Scala, these are:
Byte: It is an 8-bit signed two’s complement integer (-27 to 27 – 1, inclusive).
Short: It is a 16-bit signed two’s complement integer (-215 to 215 – 1, inclusive).
Int: It is a 32-bit signed two’s complement integer (-231 to 231 – 1, inclusive).
Long: It is a 64-bit signed two’s complement integer (-263 to 263 – 1, inclusive).
Char: It is a 16-bit unsigned Unicode character (0 to 216 – 1, inclusive).
String: String is a sequence of Chars.
Float: It is a 32-bit IEEE 754 single-precision float.
Double: It is a 64-bit IEEE 754 double-precision float.
Boolean: True or False.