apply
// 当遇到如下形式的表达式时,apply方法就会被调用
// Object参数1,...,参数N)
// 通常这样一个apply方法返回的是伴生类的对象
class Accont private (val id: Int, initialBanlance: Double){
private var balance = initialBanlance
}
object Accont{
def apply(initialBalance: Double): Accont = new Accont(1, initialBalance)
}