object Unit extends Enumeration { abstract class UnitValue(var name: String) extends Val(name) { def m: Unit } val G = new UnitValue("g") { def m { println("M from G") } } val KG = new UnitValue("kg") { def m { println("M from KG") } }}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)