Swift(Engineering > Computer Science And Engineering ) Questions and Answers
Question 1. What are the characteristics of Switch in Swift?
It supports any kind of data, and not only synchronize but also checks for equality
When a case is matched in switch, the program exists from the switch case and does not continue checking next cases. So you don't need to explicitly break out the switch at the end of case
Switch statement must be exhaustive, which means that you have to cover all possible values for your variable
All of the above
Explanation:-
Answer: Option D. -> All of the above
Question 2. What are the features of Swift Programming?
It eliminates entire classes of unsafe code
Variables are always initialized before use
Arrays and integers are checked for overflow
All of these
Explanation:-
Answer: Option D. -> All of these
Question 3. How do you declare an Iboutlet property?
IBOutlet var button:UIButton
var button:UIButton(IBOutlet)
var button:UIButtonoutlet
None of the mentioned
Explanation:-
Answer: Option D. -> None of the mentioned
Question 4. What are the control transfer statements used in Swift?
Continue
Break
Fallthrough
All of these
Explanation:-
Answer: Option D. -> All of these
Question 5. What are the advantages of Swift?
Swift is safe
Swift is fast
Swift is open source
All of the above
Explanation:-
Answer: Option D. -> All of the above
Question 6. Swift is which type of language?
scripting language
object-oriented programming language
type safe language
All of the above
Explanation:-
Answer: Option D. -> All of the above
Question 7. What are the collection types in Swift?
Dictionary and array
Array and library
Dictionary and library
Library, dictionary and array
Explanation:-
Answer: Option A. -> Dictionary and array
Question 8. Given : var stringValue:String = "Justin Gif. What is the result of stringValue = nil?
stringValue == nil
stringValue == Justin Gif"
the compiler won't allow it
None
Explanation:-
Answer: Option C. -> the compiler won't allow it
Question 9. What type of integer is denoted by "Int8"?
Open
Signed
Unsigned
Close
Explanation:-
Answer: Option B. -> Signed
Question 10. What's are the new features in Swift 4.0?
Faster, easier to use Strings that retain Unicode correctness
Smart key paths for type-safe, efficient, extensible key value coding for Swift types
Added some enhancements to creating dictionary and Set types