在Scala中扩展特征或混合特征与有什么区别?
情况1:
trait Philosophical {
def philosophize() {
println("I consume memory, therefore I am!")
}
}
class Frog extends Philosophical {
override def toString = "green"
}
情况2:
class Animal
class Frog extends Animal with Philosophical {
override def toString = "green"
}
案例1与案例2的哲学之间的区别是什么