From the course: Scala Essential Training for Data Science

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Scala data types

Scala data types

- [Instructor] Here is a list of basic Scala data types. These are scalar data types which means that they store a single value. We'll discuss arrays, lists, and other non-scalar data types in an upcoming lesson. If you've used other programming languages, this list of data types probably looks familiar. Byte, as the name implies, is used to store an 8-bit value. Short, int, long, float, and double are numeric data types. Char is used to store a single character. Let's take a look at how to work with these data types in Scala. If you followed along with the previous lesson on installing the Scala IDE, you will have installed a Scala command line tool known as a REPL, which is short for Read Eval Print Loop. Let's switch to the terminal window. I'll enter the Scala command to start the REPL. Then I'll print a welcome message and display the Scala prompt. First thing I want to do is to find a variable. Now we define variables with the var keyword followed by a variable name. In this…

Contents