From 7f130c93795402523faa1f30b859fb86613bfc4e Mon Sep 17 00:00:00 2001 From: Rafael Ruiz Date: Fri, 26 Oct 2018 10:45:32 +0200 Subject: [PATCH 1/2] Java do have default methods in interfaces. Increased explanation about java's default methods in interfaces --- src/main/scala/stdlib/Traits.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/stdlib/Traits.scala b/src/main/scala/stdlib/Traits.scala index a2530e86..8c590226 100644 --- a/src/main/scala/stdlib/Traits.scala +++ b/src/main/scala/stdlib/Traits.scala @@ -11,7 +11,7 @@ import org.scalatest._ */ object Traits extends FlatSpec with Matchers with org.scalaexercises.definitions.Section { - /** 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. + /** Similar to interfaces in Java, traits are used to define object types by specifying the signature of the supported methods. And like in Java 8 does with interfaces and default methods in them, 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. * * Here is an example: * From 1c33968d784887b97da0a20de4357e8fbff9573b Mon Sep 17 00:00:00 2001 From: Frank Rosner Date: Fri, 26 Oct 2018 12:46:56 +0200 Subject: [PATCH 2/2] Update src/main/scala/stdlib/Traits.scala Co-Authored-By: Yaskier --- src/main/scala/stdlib/Traits.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/stdlib/Traits.scala b/src/main/scala/stdlib/Traits.scala index 8c590226..e54d4d1c 100644 --- a/src/main/scala/stdlib/Traits.scala +++ b/src/main/scala/stdlib/Traits.scala @@ -11,7 +11,7 @@ import org.scalatest._ */ object Traits extends FlatSpec with Matchers with org.scalaexercises.definitions.Section { - /** Similar to interfaces in Java, traits are used to define object types by specifying the signature of the supported methods. And like in Java 8 does with interfaces and default methods in them, 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. + /** Similar to interfaces in Java, traits are used to define object types by specifying the signature of the supported methods. In traits methods can have default implementations. In contrast to classes, traits may not have constructor parameters. * * Here is an example: *