Skip to content
Search

Scala:AbstractTypeMembers

lastmod 2020-09-11created 2020-09-111 edits

In Scala, classes are parameterized with values (the constructor parameters) and with types (if classes are generic). For reasons of regularity, it is not only possible to have values as object members; types along with values are members of objects. Furthermore, both forms of members can be concrete or abstract.

Example

trait Buffer {
  type T
  val element: T
}

See also

Favorite site

author Zer0 sitemap