Which of the following is correct to cube Integer?
Correct Answer: extension Int { mutating func cube () { self = selfselfself } }
Explanation:
Note: This Question is unanswered, help us to find answer for this one
Swift Skill Assessment
Your Skill Level: Poor
Retake Quizzes to improve it
More Swift MCQ Questions
In what queue should all UI code be handled?
In what order will the following statements appear in the console? println('1') dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY _DEFAULT, 0), {println('2')}); println('3')
When declaring a function, what symbol is used to indicate that an internal parameter name should also be used as an external parameter?
What is the result of the following code? func potteryBarn (name: String, score: Int) -> String { return 'Hello (name)! Your score is (score).' } potteryBarn ('Tom' , 2)
What is the return type in the following declaration: func potteryBarn (name: String, score: Int) -> String { return 'Hello (name)! Your score is (score).'}
After importing Objective-C code to Swift, the above method will be imported as (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style;
Objective-C class can be instantiated in Swift class only through
Objective-C nullable properties will appear as __ properties when imported to Swift project.
Closures capture ____ reference of objects by default
Please check following code and tell what can be problem? import UIKitvarintVar:Int?=3 intVar = nil varstrVar:StringstrVar = nil