Skip to content

Commit 2f268e5

Browse files
committed
tweak material on Java 8 interfaces
1 parent a144211 commit 2f268e5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -554,13 +554,13 @@ 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 (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
557+
are is to view them as interfaces which can also contain code. In
561558
Scala, when a class inherits from a trait, it implements that trait's
562559
interface, and inherits all the code contained in the trait.
563560

561+
(Note that since Java 8, Java interfaces can also contain code, either
562+
using the `default` keyword, or as static methods.)
563+
564564
To see the usefulness of traits, let's look at a classical example:
565565
ordered objects. It is often useful to be able to compare objects of a
566566
given class among themselves, for example to sort them. In Java,

0 commit comments

Comments
 (0)