Google News
logo
Scala - Interview Questions
What are the Data Types in Scala?
Data types in Scala are much similar to Java regarding their storage, length, except that in Scala there is no concept of primitive data types every type is an object and starts with capital letter. A table of data types is given below.

Data Types in Scala :

Data Type Default Value Size
Boolean False True or false
Byte 0 8 bit signed value (-27 to 27-1)
Short 0 16 bit signed value(-215 to 215-1)
Char '\u0000' 16 bit unsigned Unicode character(0 to 216-1)
Int 0 32 bit signed value(-231 to 231-1)
Long 0L 64 bit signed value(-263 to 263-1)
Float 0.0F 32 bit IEEE 754 single-precision float
Double 0.0D 64 bit IEEE 754 double-precision float
String Null A sequence of characters
Advertisement