Are the following lines of code syntactically correct in Swift?
What should be the type of newValue in a property setter?
Which of the following delegations is allowed in Swift?
What are type attributes in Swift?
What is the naming convention followed for declaring the names of protocols in Swift?
What is the purpose of a protocol?
What is a strong reference cycle?
Can nested functions be called outside of the function housing the nested functions using only the name of the nested functions ?
What will be the output of the following lines of code ?
struct Test {
var someVar : Int = 0
var anotherVar : Int {
get {
someVar
}
set {
someVar = newValue
}
}
}
var test = Test(someVar: 90)
var valueOfSomeVar = test.anotherVar
test.anotherVar = 100
valueOfSomeVar = test.anotherVar
print(valueOfSomeVar)
What will be the output of the following Swift code?
class SuperClass {
func someFunc() {
print("From someFunc of SuperClass")
}
}
class SubClass: SuperClass {
override func someFunc() {
print("From someFunc of SubClass")
}
}
var someInstance = SubClass()
someInstance.someFunc()
OnSite
1 Openings
FullTime
Posted 17 days ago