Run Scala 3 online — functional + object-oriented on the JVM.
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.
Clicking "Run now" opens the playground with this exact code and a matching test case pre-loaded — passes on first Run.
import scala.io.StdIn; object Solution { def main(args: Array[String]): Unit = { val n = StdIn.readInt(); println(n * 2) } }
21
42