Created
January 13, 2018 08:36
-
-
Save agoiabel/2a52eba3bffde9f79a8c9559c5d3cdbe 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
Person { | |
var firstname: String | |
var middlename: String? | |
var lastname: String | |
func fullName() -> () { | |
print("Your fullname is \(firstname) \(middlename!) \(lastname)") | |
} | |
} | |
let anotherPerson = Person(firstname: "Abel", middlename: nil, lastname: "Adeyemi") | |
anotherPerson.fullName() //This will throw a runtime error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment