What is the main advantage of optional chaining?
Which feature in the list below does Swift not support?
Which of the following is a valid overriding operation in Swift?
What is the name of the following type of range in Swift?
1. ..<someValue
2. someValue…
3. …someValue
Which type of computed property in Swift cannot have a property observer added to it?
What is the conventional naming practice for a protocol in Swift?
What will be the output of the following lines of code?
struct Test {
var x: Int = 0
mutating func mutatingFunction() {
x += 1
}
}
let test = Test(x: 10)
test.mutatingFunction()
print(test.x)
What will happen if you run the following lines of code?
class OtherClass {
}
class SomeClass {
unowned let reference: Any? = nil
}
How do we interpolate the values of variables in a string in Swift?
What will be the output of the following lines of code ?
func arithmeticMean(_ numbers: Double...) -> Double {
var total: Double = 0
for number in numbers {
total += number
}
return total / Double(numbers.count)
}
print(arithmeticMean(1,2,4,5,9,8,7954546))
The options are:
1: For error 2: For the output 1136367.857142857