O'Reilly logo

Beginning Scala, Second Edition by Vishal Layka, David Pollak

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 8

image

Scala Type System

Types in a programming language are checked at compile time and can be inferred by a compiler. Scala has a strong and statically typed language with a unified Type system. The two fundamental design considerations of a programming language are static versus dynamic typing and strong versus weak typing.

In static typing, a variable is bound to a particular type. In dynamic typing, the type is bound to the value instead of the variable. Scala and Java are statically typed languages, whereas JavaScript, Python, Groovy, and Ruby, are dynamically typed languages.

If a type is static and strongly typed, every variable must ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required