标签:pre div rac color blog extend 属性 logs array
object soyo{ abstract class Animal{ val animal_name:String var age:Int val text_string:String="textname" } class pet extends Animal{ val animal_name: String ="pig" var age=10 override val text_string: String = "text_name" } def main(args: Array[String]): Unit = { val s=new pet println(s.animal_name) println(s.age) println(s.text_string) } }
标签:pre div rac color blog extend 属性 logs array
原文地址:http://www.cnblogs.com/soyo/p/7680473.html