Selected Reading
Scala Collections Tutorial

Scala Collections Tutorial

Quick Guide Resources Discussion

Scala has a rich set of collection library. Scala Collections may be strict or lazy. Lazy collections have elements that may not consume memory until they are accessed, like Ranges. Additionally, collections may be mutable (the contents of the reference can change) or immutable (the thing that a reference refers to is never changed). Note that immutable collections may contain mutable items.

This Scala Collections Tutorial is based on the Latest Scala 3.8.3 version.

Scala Hello World Program

The very first program in Scala is to print "Hello, World!" on the screen. The following is the Scala code that will print "Hello, World!" on the screen. You can edit and run this code by clicking on the "Edit & Run" button.

object HelloWorld {
    def main(args: Array[String]) = {
        println("Hello, world")
    }
}

Online Scala Compiler

Our Scala tutorial contains various examples in each chapter to explain the different concepts. We have provided an online compiler where you can write, save, run, and share your programs directly from your browser without setting up any development environment. Practice Scala here: Online Scala Compiler.

Audience

This tutorial has been prepared for the beginners to help them understand Scala Collections library to use Collections in Scala based programs.

Prerequisites

For this tutorial, we assume the readers to have prior knowledge of basic software development using Java or Scala. It will help if you had some exposure to the software build and deployment process.

Advertisements