我理解我现有的项目,几件事情我无法理解:在Scala中,“case class extends trait”是什么意思?
trait PeriodA {
def start: Long
def stop: Long
def description: String
def manageTo: String
}
case class PeriodEntity(
start: Long,
stop: Long,
description: String,
manageTo: String)
extends PeriodA
能否请您解释一下这里发生了什么?
您是否有其他面向对象语言的经验,如Java,C++,...? –
[在Scala中了解案例类和特征]可能的重复(http://stackoverflow.com/questions/22769175/understanding-case-class-and-traits-in-scala) –
尝试在案例类扩展特征。有很多非常详细的答案。 –