Swift - Data Types
What is the type of the value stored in the variable
char in the following Swift code?let char = "Z"
char in the following Swift code?let char = "Z"
char is assigned a string literal with double quotes, which defaults to type String in Swift.Character and StringCharacter type using single quotes or explicit type annotation, but here no annotation is given, so it is a String.char is of type String. -> Option C15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions