Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAbderrahim Gdah
1,326 Pointseverything works fine on xcode and i have done what is mentioned in the task exactly the same can anyone help me please
i think that there is something wrong in the texteditor
class Person {
let firstName: String
let lastName: String
init(firstName: String, lastName: String) {
self.firstName = firstName
self.lastName = lastName
}
func getFullName() -> String {
return "\(firstName) \(lastName)"
}
}
class Doctor : Person {
override init(firstName: String, lastName: String) {
super.init(firstName: firstName , lastName: lastName)
}
override func getFullName() -> String {
return " Dr.\(lastName)"
}
}
Person.init(firstName : "Sam" , LastName : "Smith" ).getFullName()
let someDoctor = Doctor.init(firstName: "Sam" , lastName: "Smith").getFullName()
Ettaghouti Mouad
2,195 PointsPlace this line: let someDoctor = Doctor(firstName: "Dr", lastName: "Smith") Instead this line: let someDoctor = Doctor.init(firstName: "Sam" , lastName: "Smith").getFullName()
For me it work.
Abderrahim Gdah
1,326 Pointsthanks Ettaghouti Mouad ... are you arabic ?
2 Answers
Ettaghouti Mouad
2,195 PointsYes I'am Arabic !
Abderrahim Gdah
1,326 Pointshhhh welcome ena abderrahim from tunisia this is my FB : Abderrahim gdah
Ettaghouti Mouad
2,195 PointsI'am in France but i'am tunisia too
Paul Jackson
7,585 PointsPaul Jackson
7,585 PointsThe lastName argument when you init Person has a typo. Use a lowercase "L" "l"