Introduction to Scala
First Scala program: entry point with @main and printing to the screen with println.
Simple enough for a 5-year-old to understand
Your first program
If you mark a function with @main in Scala 3, the program starts from there. println prints the text to the screen.
@main def run() = println("Hello!")Multiple lines
@main def run() = println("First line") println("Second line")🎯 Exercise & Practice
Test what you've learned — answer, write code, check instantly. (2 left)