Title: Variables And Values
Slug: variables_and_values
Summary: Variables And Values Using Scala.
Date: 2017-01-03 12:00
Category: Scala
Tags: Basics
Authors: Chris Albon

If you want a deeper guide to Scala, when I was learning I used Programming Scala and Scala for Data Science.

Values Are Immutable


In [16]:
// Create a value called greeting that is a string with the word "Hello"
val greeting: String = "Hello"

// View the value
greeting


Out[16]:
Hello

Variables Are Mutable


In [21]:
// Create a variable called age that is a "short" number (between -32768 to 32767) with the number 12
var age: Short = 12

// View the variable
age


Out[21]:
12