Skip to content

Commit a144211

Browse files
authored
Merge pull request #1216 from TAndronicus/4java-traits-java-interface
Update scala-for-java-programmers.md
2 parents a202690 + 6db002e commit a144211

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

_overviews/tutorials/scala-for-java-programmers.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,10 @@ Apart from inheriting code from a super-class, a Scala class can also
554554
import code from one or several *traits*.
555555

556556
Maybe the easiest way for a Java programmer to understand what traits
557-
are is to view them as interfaces which can also contain code. In
557+
are is to view them as interfaces which can also contain code (This
558+
feature is available in Java since version 8 using the `default` keyword
559+
as well as static methods. Default methods can be overriden in implementing
560+
classes. Since Java 9 private methods can also be used in interfaces.). In
558561
Scala, when a class inherits from a trait, it implements that trait's
559562
interface, and inherits all the code contained in the trait.
560563

0 commit comments

Comments
 (0)