Summary: A discussion of Scala type annotations and type ascription.
While Scala normally determines the type you want to use automatically, such as this Int:
scala> val x = 1
x: Int = 1
there may be times you want to control the type, such as if you want a Byte, Short, Long, Double, Float, etc. In these cases you can annotate your type when you create it, like this: