What will be the output of the following lines of code?
let string = String()
print(string.isEmpty)
What is the syntax for single-line and multi-line comments in Swift, respectively?
Which of the following is an invalid operation in Swift?
What will be the output of the following Swift code?
func test(_ label: String) -> String {
return "Hello" + label
}
What will be output of the following line of code ?
let string = "String"
print(#"The output will be \(string).”#)
What happens if the programmer does not provide a body for a function declared in a protocol?
What will be the output of the following lines of code ?
let greeting = "Guten Tag!"
for index in greeting.indices {
print("\(greeting[index])", terminator: ".")
}
What will be the output of the following Swift code?
let name: String? = nil
if let someVar = name {
print(someVar)
} else {
print("There is nil in optional")
}
What are the default integer values associated with the cases of the following enumeration in Swift?
enum CompassPoint {
case north
case south
case east
case west
}
What will be the output of the following code?
var airports: [String: String] = ["YYZ": "Toronto Pearson", "DUB": "Dublin"]
airports["LHR"] = "London Heathrow"
for (airportCode, airportName) in airports {
print("\(airportCode): \(airportName)")
}
OnSite
1 Openings
FullTime
Posted 17 days ago