语言真正是想通的,写swift让我想到了js和java
// // main.swift // StudyVarsAndConstants // // Created by UPMI_iMac01 on 15/9/19. // Copyright © 2015年 upmi. All rights reserved. // import Foundation class Student{ func sayHi() { } } class Persion:Student{ var _name:String init(name:String) { self._name = name } override func sayHi() { print("say \(self._name)") } } var student = Student() student.sayHi() var persion = Persion(name: "yihong") persion.sayHi()