Classes

class User

val user1 = new User
class Greeter(prefix: String, suffix: String) {
  def greet(name: String): Unit =
    println(prefix + name + suffix)
}

Classes in Scala are blueprints for creating objects. They can contain methods, values, variables, types, objects, traits, and classes which are collectively called members.

Classes — Structure map

Clickable & Draggable!

Classes — Related pages: