Last active
April 16, 2020 20:13
-
-
Save agoiabel/bdd898d752f28dfaee38771c3c981f9a 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 | |
} | |
//this will definitely work because i have a middlename | |
let me = Person(firstname: "Abel", middlename: "abel", lastname: "Adeyemi") | |
//This will throw an error | |
let anotherPerson = Person(firstname: "Abel", middlename: nil, lastname: "Adeyemi") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It shows me error if I use the class . Send me code using class keyword.