Reading — step 1 of 6
Learn
~1 min readFirst Steps
Scala ("scalable language") was designed in 2003 at EPFL by Martin Odersky. Runs on the JVM, fully interoperable with Java. Heavily influenced functional programming adoption in industry.
A minimal program with a top-level App:
object Main extends App {
println("Hello, Scala!")
}
The object Main is a singleton object. extends App provides a built-in main method whose body is the object's body.
Alternative explicit form:
object Main {
def main(args: Array[String]): Unit = {
println("Hello, Scala!")
}
}
No semicolons needed. Comments use // and /* ... */.
Discussion
Ask a question, share an insight, or help someone who’s stuck.
Sign in to post a comment or reply.
Loading…