A Tour of Scala
Interactive, bite-sized lessons that run in your browser
Each lesson pairs a short explanation with a live code editor: read on one side, run and tweak real Scala on the other. Nothing to install: the code runs on Scastie, the Scala Center’s online playground.
Your progress is saved in your browser; pages you’ve visited get a checkmark.
Start the tour → (or begin with the overview for a whirlwind feature tour)
Scala basics
- Overview · Welcome
- Scalculator · Expressions
- Operators are methods · Types
- Variables · Variables
- Final variables · Variables
- Printing values · IO
- String interpolation · Strings
- String formatting · Strings
- Useful operations · Operations
- Method definition · Methods
- Method definition 2 · Methods
- Method definition 3 · Methods
- Anonymous functions · Functions
- Anonymous functions 2 · Functions
- Return multiple values · Variables
- Declare multiple variables · Variables
- Assign multiple variables · Variables
- Loops using while · Loops
- Loops using for · Loops
- Loops without loops · Loops
- If · Conditions
- Match as a switch · Conditions
- Arrays · Collections
- Lists · Collections
- Sets · Collections
- Maps · Collections
- Mutable collections · Collections
- Collections: accessing elements · Collections
- Collections: concatenation · Collections
- Mutable collection operations · Collections
- Immutable collections with var · Collections
- Collections: useful methods · Collections
- Classes · Classes
- Classes, continued · Classes
What's new in Scala 3
- Scala 3: what changed · Scala 3
- Optional braces & new control syntax · Scala 3
- Top-level definitions & @main · Scala 3
- Enums & ADTs · Scala 3
- Extension methods · Scala 3
- given & using · Scala 3
- Union & intersection types · Scala 3
- Smaller niceties · Scala 3