Ad space (banner)
Lesson 2 / 20

Your first output (println)

This lesson covers the basics of printing in Scala with println.

println("...") displays text on the screen. Scala is highly compatible with Java while being designed to let you write the same thing more concisely.

In the sample code, a single line — println("Hello, Scala!") — sits inside the fixed object Main extends App { ... } frame.

A common early stumble is not realising you can skip Java's public static void main. In Scala, simply extending the App trait makes the code you write inside it the program's starting point.

In professional work, Scala is well known as the language Apache Spark is written in, and is widely used across big-data processing.

๐Ÿ“– Reference code
โœ๏ธ Your code
Type your code, then press "Run"

๐Ÿงช This site can't compile or run Scala directly, so it checks on the spot whether what you typed matches the reference code (scoring happens entirely in your browser โ€” nothing is sent anywhere).

Ad space (banner)
Ad space (in-article)