πŸ§ͺ Swift (programming language) MCQ Quiz Hub

Swift Multiple Choice Questions and Answers Set 1

Choose a topic to test your knowledge and improve your Swift (programming language) skills

How can we prioritize the usability of the demand Process?





βœ… Correct Answer: 4

What are the features of Swift Programming?





βœ… Correct Answer: 4

The expression that creates a closure in Swift is called ____ in other languages it is also called a Lambda or Anonymous Function.





βœ… Correct Answer: 2

What does the question mark (?) indicate A particular property is





βœ… Correct Answer: 3

What are the common execution states in iOS?





βœ… Correct Answer: 4

What are the advantages of swift?





βœ… Correct Answer: 4

What statement can be used to stop the execution of a loop, if, or switch statement?





βœ… Correct Answer: 4

How many types of integers are in Swift?





βœ… Correct Answer: 3

What are the disadvantages of Swift?





βœ… Correct Answer: 3

Which of the following is not a literals in swift?





βœ… Correct Answer: 2

Numbers with decimal values or fractional components are called?





βœ… Correct Answer: 3

Which of the following features of Swift programming language?





βœ… Correct Answer: 4

In Swift programming language, single-line comments are started with ___________?





βœ… Correct Answer: 2

In Swift programming language, single-line comments are started with ___________? A. single slashes B. double slashes C. asterisk D. hash





βœ… Correct Answer: 2

___________ is a process of querying and calling properties





βœ… Correct Answer: 3

How many types of classes in Inheritance in Swift?





βœ… Correct Answer: 2

How many varieties of collection types in Swift?





βœ… Correct Answer: 2

Which Of The Following Is Incorrect Data Type In SWIFT ?





βœ… Correct Answer: 3

Which Of The Following Is Incorrect Value Type Of The Swift?





βœ… Correct Answer: 4

The class which inherits the properties from other class is called child class or sub class





βœ… Correct Answer: 1

What are the characteristics of Switch in Swift?





βœ… Correct Answer: 4

How do you declare an Iboutlet property?





βœ… Correct Answer: 4

What are the features of Swift Programming?





βœ… Correct Answer: 4

What are the control transfer statements used in Swift?





βœ… Correct Answer: 4

What are the advantages of Swift?





βœ… Correct Answer: 4

What's are the new features in Swift 4.0?





βœ… Correct Answer: 4

What type of integer is denoted by "Int8"?





βœ… Correct Answer: 2

Given : var stringValue:String = β€œJustin Gif”. What is the result of stringValue = nil?





βœ… Correct Answer: 3

What are the collection types in Swift?





βœ… Correct Answer: 1

Swift is which type of language?





βœ… Correct Answer: 4

Choose all correct statements. S1: Swift was developed by Apple Inc S2: Swift has file name extension as .swift S3: Swift is an alternative to the Objective-C language





βœ… Correct Answer: 4

Which among the following is not an Swift feature?





βœ… Correct Answer: 4

What is the file extension for Swift programs?





βœ… Correct Answer: 3

How to compile and run a script in one step?





βœ… Correct Answer: 1

How to compile a script?





βœ… Correct Answer: 3

Which command is used to get the current version of swift?





βœ… Correct Answer: 2

Which is a valid variable name in Swift?





βœ… Correct Answer: 1

Which among the following is a characteristic of Lazy Stored Procedures?





βœ… Correct Answer: 4

Choose the correct Statements: S1: computed properties are built with a getter and a setter. S2: computed properties are always variables and cant be constants. S3: computed properties store something on an object and affect its memory.





βœ… Correct Answer: 1

Which is not a property of type properties in Swift?





βœ… Correct Answer: 4

The built-in numeric types in Swift





βœ… Correct Answer: 3

Which symbol is used to separate digits in numeric literals





βœ… Correct Answer: 1

Choose the correct evaluated statement





βœ… Correct Answer: 2

The supported architecture for round, ceil and floor in Swift is/are





βœ… Correct Answer: 3

What is the general form of Random number generation in Swift?





βœ… Correct Answer: 4

Which among the following throws runtime error in Swift?





βœ… Correct Answer: 2

Which special character doesn’t require escape sequence in order to use them in string literals?





βœ… Correct Answer: 4

Which among the following is not true with respect to concatenation of strings in Swift?





βœ… Correct Answer: 4

Which statements evaluates to true while checking the equal strings in swift?





βœ… Correct Answer: 3

Which method is used to check for prefix in Swift?





βœ… Correct Answer: 1

Which method is used in String Iteration in Swift?





βœ… Correct Answer: 2

Which among the following operations are valid with respect to Strings in Swift? let string = "Super Power" S1: string[2] S2: string.characters[2]





βœ… Correct Answer: 4

Choose the correct expression





βœ… Correct Answer: 2

How to conver the given String to uppercase in Swift? Given let string = "HhEeLlLlOo"





βœ… Correct Answer: 1

Which are the Boolean Logical Operators used in Swift?





βœ… Correct Answer: 1

Which operator is used to negate a Bool in Swift?





βœ… Correct Answer: 1

Which type are arrays in Swift?





βœ… Correct Answer: 2

Which among the following array declarations is invalid?





βœ… Correct Answer: 4

Which of the following are supported by swift with respect to arrays?





βœ… Correct Answer: 4

How to define an array with repeated values?





βœ… Correct Answer: 3

Which method is used to extract values of a given type from an Array in Swift?





βœ… Correct Answer: 1

How to filter out nil from an Array transformation?





βœ… Correct Answer: 4

In the array color, how to remove "green" without knowing its index var color = ["red", "blue", "green", "yellow", "black"]





βœ… Correct Answer: 1

Which among the following is false with respect to map in Swift?





βœ… Correct Answer: 2

Which method is used to compare two arrays in swift?





βœ… Correct Answer: 3

Which of following array operations supported by Swift?





βœ… Correct Answer: 4

Which of following methods are valid in Array operations in Swift? Given: var helloArray:[Int] = [1,2,3,4,5] S1: helloArray.indexOf(2) S2: helloArray.first S3: helloArray.min() S4: helloArray.append(6)





βœ… Correct Answer: 4

Which among the following is the feature of tuple in Swift?





βœ… Correct Answer: 4

Which among the following cant be done with respect to tuples in swift?





βœ… Correct Answer: 4

How to swap the given tuples in swift? var a = 0 var b = 1





βœ… Correct Answer: 1

Which among the following is true with respect to Enum in Swift? S1: Enum cases can contain one or more associated values. S2: Enums can be recursive S3: Enums can have custom init methods S4: Enums can be nested





βœ… Correct Answer: 2

Which keyword makes the enum store its payload with a layer of indirection in Swift?





βœ… Correct Answer: 1

Choose the correct statements





βœ… Correct Answer: 2

How to get enum value's corresponding raw value?





βœ… Correct Answer: 1

What doe the hash value of specific enum return?





βœ… Correct Answer: 2