Intermediate
Swift
Q77 / 100
What is a Swift associated type with a default?
Correct! Well done.
Incorrect.
The correct answer is B) An associated type with a default concrete type: associatedtype Element = Int, used when a conforming type doesn't specify it
B
Correct Answer
An associated type with a default concrete type: associatedtype Element = Int, used when a conforming type doesn't specify it
Explanation
protocol Sequence { associatedtype Element } — if conforming type doesn't specify Element, the default applies. Reduces conformance boilerplate for common cases.
Progress
77/100