Created
September 23, 2021 19:40
-
-
Save MoussaHellal/ab7fbc1373a15738470d0111f4d55d9c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Human { | |
static var name = "Mousa" | |
class var age : Int { | |
return 27 | |
} | |
} | |
// Type Method : we accessed both properties without even creating an instance of Human Class. | |
print(Human.name) | |
print(Human.age) | |
class SuperHuman: Human { | |
override static var name = "Super Human" // Cannot override with a stored property 'name' | |
override class var age : Int { | |
return 1000 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment