Restart the Inheritance
#inherittance
Overview
Below example shows how to restart the inheritance
class Ewok {
var fluffinessPercentage = 100
}
var chirpa = Ewok()
var wicket = Ewok()
chirpa.fluffinessPercentage = 90
print(wicket.fluffinessPercentage) // print: 100
print(chirpa.fluffinessPercentage) // print: 90
class Ewok {
var fluffinessPercentage = 100
}
var chirpa = Ewok()
var wicket = chirpa
chirpa.fluffinessPercentage = 90
print(wicket.fluffinessPercentage) // print: 90
print(chirpa.fluffinessPercentage) // print: 90
Sample Codes
Sources
Videos
Articles / Documents
Last updated
Was this helpful?