class Base { var base_x = 0 static var base_y = 1 final var base_z = 12 func baseInc() { base_x += 1 } class func baseMuti() { base_y -= 1 } } class Parent { func parentInc() { print("parnetInc") } } class Child: Base { //属性也加override override var base_x: Int { willSet { print("base_x 设置") } } //静态方法重写 override class func baseMuti() { base_y -= 2 } //base_z 被final 不能重写 // override var base_z = 15 } var child = Child() child.baseInc() //静态方法也继承 Child.baseMuti() print(Child.base_y) //base_z 被final child.base_z = 14 print(child.base_z)