Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
init-class-subclass-overriding-designated
class Male: Person {
let gender = "M"
var hairLength: String
init(hairLength: String, name: String, height: String, weight: String) {
self.hairLength = hairLength
print(self.hairLength)
super.init(name: name, height: height, weight: weight)
print(self.name)
}
convenience init(name: String) {
self.init(hairLength: "3cm", name: "Kristof Kocsis", height: "195cm", weight: "80kg")
}
override init(name: String, height: String, weight: String) {
self.hairLength = "0"
super.init(name: name, height: height, weight: weight)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment