본문 바로가기

Programming/Swift

Can an array contain different data types?

Arrays can contain any type of element value (primitive types or objects), but you can't store different types in a single array. You can have an array of integers or an array of strings or an array of arrays, but you can't have an array that contains, for example, both strings and integers.

>> 하나의 array는 같은 종류의 데이타 타입만 담을 수 있다.

 

 

 

'Programming > Swift' 카테고리의 다른 글

Value and Reference Types  (0) 2020.12.10
Collection Types in Swift  (0) 2020.11.27
When to use guard let rather than if let  (0) 2020.11.27
Nil coalescing  (0) 2020.11.25
What is Cyclomatic complexity?  (0) 2020.11.25