Scala · online compiler

Run Scala online

Run Scala 3 online — functional + object-oriented on the JVM.

Version
Firecracker microVM live per-test verdicts multi-file compile

Scala unifies functional and object-oriented programming on the JVM: pattern matching, algebraic data types, higher-kinded types, and (in Scala 3) a much cleaner syntax with given/using in place of the old implicits.

ls-judge runs Scala 3.x on a supported JVM inside a Firecracker microVM.

Starter code

What you get in Scala

Clicking "Run now" opens the playground with this exact code and a matching test case pre-loaded — passes on first Run.

scala
Scala 3
import scala.io.StdIn; object Solution { def main(args: Array[String]): Unit = { val n = StdIn.readInt(); println(n * 2) } }
stdin →21
expected →42
FAQ

Common questions about Scala on ls-judge

Scala 2 or 3?
Scala 3.
sbt / Maven?
No — sandbox has no network to fetch dependencies.
Scala.js / Scala Native?
JVM only.
Free?
Yes.
Further reading
Also try