Scala Examples

Scala syntax highlighting

Scala Example

Minimal sample showing keywords, strings, functions, types, comments, and XML literals.

object App extends App { // line comment /* block comment */ def greet(name: String): String = { val msg = "Hello, " + name msg } val xml = <note>Hi {greet("World")}!</note> val multi = """This is a multi-line string""" val value: MyType = MyType(42) }