Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
init-class-subclass-convenience
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")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment