Last active
January 13, 2018 08:35
-
-
Save agoiabel/3ce78b3909a0ab67ef835df16e593d77 to your computer and use it in GitHub Desktop.
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
Person { | |
var firstname: String | |
var middlename: String? //we created the optional with the ? | |
var lastname: String | |
func fullName() -> () { | |
print("Your fullname is \(firstname) \(middlename!) \(lastname)") | |
} | |
} | |
let me = Person(firstname: "Abel", middlename: "Agoi", lastname: "Adeyemi") | |
me.fullName() //will return "Your fullname is Abel Agoi Adeyemi" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment