final class func
와 동일한 방식class Friend{
func sayHi(){
print("안녕")
}
final class func sayHo(){
print("호호")
}
static func sayHoo{
print("후후")
}
}
class BestFriend: Friend{
class override func sayHi(){
print("덮어씌운 안녕")
}
func sayHoo(){
print("덮어씌운 호호")
}
}
let myFriend = Friend()
myFriend.sayHi() //안녕
Friend.sayHo() //호호
Friend.sayHoo() //후후
BestFriend.sayHi() //덮어씌운 안녕
BestFriend.sayHoo() //후후