构造函数 似乎每一门语言都要搞一套自己的构造函数体系
Java
class A{
A(){
super()
// this()
}
A(..){}
}
Kotlin
class A constrcutor(...1):super() /*或者this()*/{
constrcutor(...2) { // 第二个构造函数
}
init(){
}
}
python
class A:
def __init__(self, a, b= 2): # 基于python的动态性,多种参数类型,基本上一个方法就行了,用不着方法重载了
supe().__init__(a)