var name: String = "HAG" // ܕΛলུ͢Δ͜ͱՄೳ var number = 10 // ఆٛࡁΈͷมʹޙ͔ΒΛೖΕΒΕΔ num = 45 number = 29 // ͜Εܕ͕ҧ͏͔Βμϝ(ErrorʹͳΔ·͢) name = 45 // ͜Εೖͬͯͳ͍͔Βμϝ(ErrorʹͳΔ·͢) var number: Int // nilೖΕ͓ͯ͘͜ͱͰ͖ͳ͍ʢErrorʹͳΔ·͢) var number: Int = nil // มΛར༻͢Δ print("number is: \(number)")
SHAPE" let double: Double = 114.514 // ܕΛলུ͢Δ͜ͱͰ͖Δ let age = 25 // ఆٛࡁΈͷఆʹޙ͔ΒΛೖΕΔ͜ͱͰ͖ͳ͍(͜ΕΤϥʔʹͳΔ·͢) name = “Onii-chan” // ఆٛͨ͠ܕͱಉ͔͡͠ೖΕΒΕͳ͍(͜ΕΤϥʔʹͳΔ·͢) let number: Int = "are you ok?" let string: String = 2020 // ͜Εೖͬͯͳ͍͔Βμϝ(ErrorʹͳΔ·͢) let number: Int // nilೖΕ͓ͯ͘͜ͱͰ͖ͳ͍ʢErrorʹͳΔ·͢) let number: Int = nil // ఆΛར༻͢Δ print(“your age is... \(100000 + age)”) print("Oh! you are !")