diff --git a/_tour/traits.md b/_tour/traits.md index 464ad1b4f0..ce0a115270 100644 --- a/_tour/traits.md +++ b/_tour/traits.md @@ -12,7 +12,7 @@ prerequisite-knowledge: expressions, classes, generics, objects, companion-objec redirect_from: "/tutorials/tour/traits.html" --- -Traits are used to share interfaces and fields between classes. They are similar to Java 8's interfaces. Classes and objects can extend traits but traits cannot be instantiated and therefore have no parameters. +Traits are used to share interfaces and fields between classes. They are similar to Java 8's interfaces. Classes and objects can extend traits, but traits cannot be instantiated and therefore have no parameters. ## Defining a trait A minimal trait is simply the keyword `trait` and an identifier: @@ -78,4 +78,4 @@ animals.append(dog) animals.append(cat) animals.foreach(pet => println(pet.name)) // Prints Harry Sally ``` -The `trait Pet` has an abstract field `name` which gets implemented by Cat and Dog in their constructors. On the last line, we call `pet.name` which must be implemented in any subtype of the trait `Pet`. +The `trait Pet` has an abstract field `name` that gets implemented by Cat and Dog in their constructors. On the last line, we call `pet.name`, which must be implemented in any subtype of the trait `Pet`.