我是一個新手,我在密封關鍵字reding,並提到sealed object。我用Google搜索,但沒有找到使用密封方法的簡單例子android.I試圖像 class A
{
//declarations
}
class B extends A
{
//here i would like to use my sealed override keyword
}
誰能告訴我如
我只是想知道是否可以在Scala中重複密封特徵? 如果沒有,爲什麼不可能?既然這個特質是密封的,它應該是不可能的? 我想要做的就是這樣的事情: sealed trait ResizedImageKey {
/**
* Get the dimensions to use on the resized image associated with this key
*/
我想知道是否有這樣做的更好的方式: sealed abstract class Edge(val id: String)
case class LabeledEdge(override val id: String, label: String)
extends Edge(id)
case class WeightedEdge(override val id: String, wei