Last active
May 11, 2021 12:12
-
-
Save alperenarc/fe04647113acd5a0f019995e60ba0140 to your computer and use it in GitHub Desktop.
Person
This file contains 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 Person { | |
var name: String | |
init(name: String) { | |
self.name = name | |
} | |
func printMyName() { fatalError("Error here 😈") } | |
func printMyAge(age: Int) { } | |
} | |
class MainController: Person { | |
override func printMyAge(age: Int) { | |
print(age) | |
} | |
} | |
let mainControllerInstance = MainController(name: "Alperen") | |
mainControllerInstance.printMyAge(age: 21) | |
print(mainControllerInstance.name) | |
mainControllerInstance.printMyName() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment