标签:
声明变量
ArrayBuffer[Int]()或ArrayBuffer[Int]
生成私有字段age、读方法age()和写方法age_=(...)
calss Person{@BeanProperty var age=0}
class Person(var name:String = "a", var age:Int = 1){
println("i was created")
def desc()= name+","+age
println(this.desc)
}
class Person {
var age=0
def this(age:Int){
this() //调用主构造器
this.age = age
}
}
标签:
原文地址:http://www.cnblogs.com/thinkpad/p/4693926.html