Swift MCQ Questions - Mobile Development
11. Which of the following is not a literals in swift?
A. Binary Literals
B. Quad Literals
C. Hexadecimal Literals
D. Decimal Literals
View Answer
Ans : B
Explanation: Quad Literals is not a literals in swift.
12. Numbers with decimal values or fractional components are called?
A. decimal number
B. integer number
C. floating numbers
D. All of the above
View Answer
Ans : C
Explanation: Numbers with decimal values or fractional components are called floating numbers. For example: 1.34 is a floating point number. Floating point types can represent a wider range of values than integer types.
13. Which of the following features of Swift programming language?
A. Swift is very easy to learn and precise to use
B. Automatic memory management
C. Swift follows Objective-C like syntax
D. All of the above
View Answer
Ans : D
Explanation: All of the above are features of Swift programming language.
14. In Swift programming language, single-line comments are started with ___________?
A. single slashes
B. double slashes
C. asterisk
D. hash
View Answer
Ans : B
Explanation: In Swift programming language, single-line comments are started with double slashes
15. _____________ is a process of querying and calling properties
A. Lazy Chaining
B. Swift Chaining
C. Optional Chaining
D. All of the above
View Answer
Ans : C
Explanation: In Swift programming language, Optional Chaining is a process of querying and calling properties. You can chain multiple queries together, but if any link in the chain is nil then, the entire chain fails.
16. How many types of classes in Inheritance in Swift?
A. 1
B. 2
C. 3
D. 4
View Answer
Ans : B
Explanation: There are two types of classes in Inheritance in Swift : Sub class and Super class
17. How many varieties of collection types in Swift?
A. 2
B. 3
C. 4
D. 5
View Answer
Ans : A
Explanation: There are two varieties of collection types in Swift: Array and Dictionary.
18. Which Of The Following Is Incorrect Data Type In SWIFT ?
A. UInt
B. Double
C. Char
D. Optional
View Answer
Ans : C
Explanation: Char Is Incorrect Data Type In SWIFT.
19. Which Of The Following Is Incorrect Value Type Of The Swift?
A. Double
B. Character
C. Enum
D. Class
View Answer
Ans : D
Explanation: Class Is Incorrect Value Type Of The Swift.
20. The class which inherits the properties from other class is called child class or sub class.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, The class which inherits the properties from other class is called child class or sub class.
Discussion