Scala combines the functional/type-inference paradigm and the object-oriented paradigm, and is also meant to be an improved version of Java. Scala is the native language of Apache Spark.
In [ ]:
class Greeter(prefix: String, suffix: String) {
def greet(name: String): Unit =
println(prefix + name + suffix)
}
In [ ]:
val greeter = new Greeter("Hello, ", "!")
greeter.greet("Scala developer") // Hello, Scala developer!
In [ ]:
new Plot { title = "Interactive Plots in Scala"}.add(new Bars { y = Seq(3, 5, 2, 3, 7)})