When this code is executed, what is the value of the
import Foundation let ns = NSString("Hello") let swift = String(ns)
Correct answer: This code will not compile.
Explanation: While it is possible to typecast an
NSString into a
String using an initializer without a label, it is not possible the other way around. The code should read
let ns = NSString(string: "Hello").