What is the advantage of using abstract classes instead of traits?
问题 What is the advantage of using an abstract class instead of a trait (apart from performance)? It seems like abstract classes can be replaced by traits in most cases. 回答1: I can think of two differences Abstract classes can have constructor parameters as well as type parameters. Traits can have only type parameters. There was some discussion that in future even traits can have constructor parameters Abstract classes are fully interoperable with Java. You can call them from Java code without