Escolar Documentos
Profissional Documentos
Cultura Documentos
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
While declaring an enumeration, multiple member values can appear in a single line, They are separated
ywhich of the following punctuation marks?
Semi-colon
Colon
Comma
Slash
Point
Which keyword is used in Swift when we want a property of a class to initialize when it is accessed for the firs
me?
let
var
const
lazy
Which one of the below function definitions is wrong considering Swift language?
func haveChar(#string: String, character: Character) -> (Bool)
func mean(numbers: Double)->Double
func minMax(array: [Int]) -> (min: Int?, max: Int?)
func minMax(array: [Int]) -> (min: Int, max: Int)?
let x = [Int]()
switch myChar { case "a","A": println("The letter A") case "b","B": println("The letter A") }
switch myChar { case "a": println("The letter A") }
switch myChar { case "a": case "A": println("The letter A") default: println("Not the letter A") }
switch myChar { case "a","A": println("The letter A") default: println("Not the letter A") }
Which keyword in the context of a Switch statement is required to force the execution of asubsequent case?
fallthrough
continue
break
return
release
ar x = 0
r index in 15
++x
intln("\(x)")
Rs. 0.00
compile error
Rs. 5.00
Rs. 4.00
Which one will createa dictionary with a key type of Integer and value of String?
var dict:[Int: String] = ["one":1]
var dict: [Int: String] = [1:"one"]
var dict: [String: Int] = [1:"one"]
var dict = ["one":1]
Objective-C Blocks are translated by using which of the following Swift Language features?
Lambda
Callback
Closure
Selector
Which of these statements is a valid way to extend the capabilities of our theoretical class 'MyClass' to
onform to protocol 'MyProtocol'?
extension MyClass(MyProtocol) { }
extension MyClass, prot MyProtocol { }
extension MyClass: MyProtocol { }
extension MyClass, MyProtocol { }
Considering var index = UInt8.max, which of the following operation results to the value of zero forvar
ndex?
index = index &- 1
index = index &+ 1
index = index &* 1
index = index &/ 255
What is the name of the Xcode generated header file used to import Swift classes into an Objective-C Class
iven a product module named Example?
ExampleSwift.h
Example.Swift.h
Example+Swift.h
Example-Swift.h
How would you declare a variable named 'awesome' of type 'Double' in Swift?
Double awesome
var: double awesome
var awesome:Double
class
static
All of the mentioned
et a = [35,44]
et b = a
[1] = 55
a = [ 33,44]
b = [33, 55]
a = [ 33,55]
b = [33, 55]
compiler will not allow it
Solution