Swift MCQ Test: Swift MCQs - Practice Questions
1. Explain the concept of Swift's 'Set' type.
2. Which collection type in Swift is unordered and does not allow duplicate elements?
3. Explain Swift's 'associatedtype' in protocols.
4. What is the purpose of the 'break' statement in a loop?
5. What is the purpose of the Swift 'enum' type?
6. Explain the concept of protocol-oriented programming in Swift.
7. In Swift, how do you handle errors using the 'try', 'catch', and 'throw' keywords?
8. How can you achieve multithreading in Swift?
9. Which operator is used for equality comparison in Swift?
10. What is the 'nil coalescing operator' (??) used for in Swift?
11. What is the correct way to concatenate two strings in Swift?
12. Which Swift data type is used to store whole numbers?
13. What are the benefits of using Swift Optionals?
14. What is the purpose of Swift's 'defer' statement?
15. Explain the concept of Swift's 'inout' parameter.
16. How does Swift handle multiple return values from a function?
17. What is the purpose of the 'unowned' keyword in Swift?
18. Which Swift data type is used to store decimal numbers?
19. What are generics in Swift?
20. How do you declare a property as 'weak' in Swift?