import Foundation
println("Hello, World!")
class People {
var name:String?
init(){
self.name="李四"
}
//防止重写关键字 @final
@final var age = 15
}
class Man : People{
init(){
super.init()
}
}
let p = Man()
p.name = "张三"
println("p name is \(p.name)")
let p2 = Man()
println("p2 name is \(p2.name)")
Swift_7_继承
最新推荐文章于 2017-08-03 14:07:22 发布