Dienstag, 5. April 2011

scala -- trait

scala -- trait

A trait is a abstract class that is meant to be combined with other classes.

Some traits play the role of interface in Java, ie. they define a set of abstact methods which are implemented by some class.

But unlike interfaces, traits in Scala can also contain metod implementations or fields.

excerpted from An overview of the Scala Programming Language, p5.

see also :

A Tour of Scala: Traits
http://www.scala-lang.org/node/126


Keine Kommentare: