본문 바로가기

Programming/Swift

야곰 스위프트 기초 퀴즈 - 데이터 타입

let numberOne: Int = 123

let numberTwo: Double = 123

let numberThree: UInt = -123 Negative integer '-123' overflows when stored into unsigned type 'UInt'

let character: Character = 'A' Single-quoted string literal found, use '"'

let string: String = "A"

 

var arrayOne: Array<Int> = [1,2,3]

var arrayTwo: [Int] = Array<Int>()

var arrayThree:[Int] = [Int] Cannot convert value of type '[Int].Type' to specified type '[Int]'

var dictionaryOne: Dictionary<String> = Dictionary<String>() Generic type 'Dictionary' specialized with too few type parameters (got 1, but expected 2)

var dictionary:[String:Int]=["key":100]