MCQs > IT & Programming > Swift > In context of a Swift subscript, which of the following is correct?

Swift MCQs

In context of a Swift subscript, which of the following is correct?

Answer

Correct Answer: struct MyStruct { var myStr = [String]() subscript (index : Int) -> String{ get{ return myStr[index] } set{ myStr[index] = newValue } } }

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