What is the keyword used to declare class-only protocols in Swift?
What keyword is used to declare optional requirements in protocols?
Can we change a read-only property to a read-write property when overriding in Swift?
How do you call the superclass's method in a subclass when the method is overridden?
Which of the following data types in Swift is used by reference counting for automatic memory management?
Which is the correct way to conform to a protocol in Swift?
What will be the output of the following lines of code ?
func something() {
var nos = 0
func somethingInsideSomething() {
nos = nos+5
nos %= 8
nos = nos+90
}
somethingInsideSomething()
print(nos)
}
something()
What will be the output of the following code?
class SomeClass {
deinit {
print("Deinited")
}
}
var someInstance: SomeClass? = SomeClass()
someInstance = nil
What will be the output of the following lines of code?
func test(_ arr: [Int]) -> (min: Int, max: Int) {
return (arr.min()!, arr.max()!)
}
let something = test([1, 2, 3, 4, -1])
print(type(of: something))
What will be the output of the following code?
struct SomeStruct {
var someArr = [1, 2, 3, 4]
subscript(i: Int) -> Int {
get {
return someArr[i]
}
set {
someArr[i] = newValue
}
}
}
var someIns = SomeStruct()
someIns[3] = 5
print(someIns.someArr)
OnSite
1 Openings
FullTime
Posted 17 days ago