Skip to content

Commit ad55d57

Browse files
committed
Java 8 can have "traits" too, the way they are defined here
1 parent aadcda2 commit ad55d57

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tutorials/tour/traits.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ tutorial-next: mixin-class-composition
1010
tutorial-previous: classes
1111
---
1212

13-
Similar to interfaces in Java, traits are used to define object types by specifying the signature of the supported methods. Unlike Java, Scala allows traits to be partially implemented; i.e. it is possible to define default implementations for some methods. In contrast to classes, traits may not have constructor parameters.
13+
Similar to interfaces in Java, traits are used to define object types by specifying the signature of the supported methods. Like in Java 8, Scala allows traits to be partially implemented; i.e. it is possible to define default implementations for some methods. In contrast to classes, traits may not have constructor parameters.
1414
Here is an example:
1515

1616
trait Similarity {

0 commit comments

Comments
 (0)