July 2019
Intermediate to advanced
163 pages
2h 12m
English
Traits are like interfaces with default implementations and state.
Those familiar with Java 8 know that it added the default methods feature to interfaces. Traits are similar to Java 8 interfaces but with the added ability to have state (fields). This allows more flexibility but should be treated with caution.
As this code demonstrates, Traits can have properties, methods, and abstract methods. If a class implements a ...
Read now
Unlock full access