Which of the following unary operators are not available in Swift?
What do we write or declare in the body of a protocol?
Complete the following lines of code to print the shopping list items with their indices.
Which one of the following is a valid statement for declaring a custom operator in Swift?
What will be the correct function call for the function defined below?
func test(forLabel label: String) {
print(label)
}
What is the type of property declared on line 2 in the following class?
1 class SomeClass {
2 var someVar : Int = 20
3 static var anotherVar: Int = 30
4 }
Which is the correct way to declare a function returning an opaque type in Swift?
Which of the following is the correct way to call a property wrapper's initializer in Swift?
What will be the output of the following code?
class SomeClass {
var test = Int()
}
let someInstance = SomeClass()
someInstance.test = 49
var anotherInstance = someInstance
anotherInstance.test = 50
print(someInstance.test)
print(anotherInstance.test)
What will be the output of the following code?
let somePoint = (1, 1)
switch somePoint {
case (0, 0):
print("\(somePoint) is at the origin")
case (_, 0):
print("\(somePoint) is on the x-axis")
case (0, _):
print("\(somePoint) is on the y-axis")
case (-2...2, -2...2):
print("\(somePoint) is inside the box")
default:
print("\(somePoint) is outside of the box")
}
OnSite
1 Openings
FullTime
Posted 17 days ago