/**
* Created by jack on 2017/8/1.
*/
trait Abstract {
type T
def transform(x: T): T
val initial: T
val current: T
def display:T
}
class Concrete extends Abstract {
override type T = String
override def transform(x: T): T = {
x + x
}
override val initial: T = "init"
override val current: T = "current"
override def display: String = current
}
class Concrete1 extends Abstract {
override type T = Int
override def transform(x: Int) = {
x
}
override val initial = 0
override val current = 12
val display: Int = current
}
object AbstarctMP extends App {
val x = new Concrete()
println(x.transform("hello"))
val y = new Concrete1()
println(y.display)
}