MCQs > IT & Programming > Swift > How will ARC handle 'Country' instance and 'country2' reference when 'country1' is set to 'nil'?

Swift MCQs

How will ARC handle "Country" instance and "country2" reference when "country1" is set to "nil"?

class Country{ let name: String init(name: String){ self.name = name } } var country1: Country? var country2: Country? country1 = Country(name: "Bangladesh") country2 = country1

Answer

Correct Answer: ARC will not deallocate the Country instance and country2 will hold it’s name "Bangladesh"

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Swift Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Swift Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it