MCQs>IT & Programming>Swift>Use the classes defined above to create a new Person instance, and try to access its numberOfRooms property as before?
Swift MCQs
Use the classes defined above to create a new Person instance, and try to access its numberOfRooms property as before?
Answer
Correct Answer: let john = Person() if let roomCount = john.residence?.numberOfRooms { println("John's residence has \(roomCount) room(s).") }else{ println("Unable to retrieve the number of rooms.") }
Explanation:
Note: This Question is unanswered, help us to find answer for this one