MCQs | Swift (programming language)/Swift Multiple Choice Questions and Answers Set 2 Sample Test,Sample questions

Question:
________ is a process of querying and All of the abovecalling properties

1.Swift Chaining

2.Optional Chaining

3.Lazy Chaining

4.All of the above


Question:
Constants are declared by using _____ keyword and variables by _______ keyword.

1. let, var

2.let, let

3.var, let

4.var, var


Question:
Given : var stringValue:String = "Somthing". What is the result of stringValue = nil?

1.stringValue == nil B) C)

2.stringValue == "Somthing"

3.the compiler won't allow it

4.None of the above


Question:
In Swift programming language, single-line comments are started with _______?

1.Hash

2.Asterisk

3.Single Slashes

4.Double Slashes


Question:
Numbers with decimal values or fractional components are called?

1. integer number

2.floating numbers

3.decimal number

4.All of the above


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

1.Control

2.Defined

3.Parameter

4.Closure Expression


Question:
What is the meaning of question mark "?" in Swift?

1. used in loop declaration

2.used in function declaration

3.used in property declaration

4.used in parameter declaration


Question:
Which Of The Following Framework Is Not Used In IOS?

1.AppKit Framework

2.UIKit Framework

3.Foundation Framework

4.CoreMotion Framework


Question:
____________ is a process of querying and calling properties

1.Lazy Chaining

2.Swift Chaining

3.Optional Chaining

4.All of the above


Question:
To Create Mutable Object __ Is Used

1.Let

2.Var

3.Both A&B

4.None


Question:
Which Of The Following IOS Frameworks Is A Commonly Used Third Party Library?

1.AVFoundation.framework

2.Audiotoolbox.framework

3.AFNetwork.framework

4.Audiotoolbox.framework


Question:
Which of the following is true about Swift?

1.Swift is an open-source programming language

2.Swift is used in iOS development

3.Swift can be compiled as a dynamic framework

4.All of the above


Question:
__________ is a hierarchy of objects that obtain the opportunity to respond to the events.

1.Regular Expression

2.Dictionary

3.Responder Chain

4.None of the above


Question:
A function inside a function is called a nested function in swift?

1.True

2.False

3.Can be true or false

4.Can not say


Question:
Constants are declared by using _____ keyword and variables by _______ keyword.

1.var, let

2. let, let

3.var, var

4.let, var


Question:
Enum is also known as Swift Enumeration.

1.Yes

2.No

3.Can be yes or no

4.Can not say


Question:
Given : var stringValue:String = "Justin Gif. What is the result of stringValue = nil?

1.stringValue == nil

2.stringValue == Justin Gif"

3.the compiler won't allow it

4.None


Question:
How can you make a property optional in Swift?

1.You have to declare a question mark & in the code to make a property optional

2.You have to declare a question mark ? in the code to make a property optional

3.You have to declare a question mark ?? in the code to make a property optional

4.None of the above


Question:
In Swift4, functions can be categorized in __________ types.

1.1

2.2

3.3

4.4


Question:
IOS Stands For ?

1.Internetwork Operating System

2.IPhone Operating System

3.Internet Operating System

4.None Of Them


Question:
Numbers with decimal values or fractional components are called?

1.decimal number

2. integer number

3. floating numbers

4. None of the above


Question:
Swift is an open-source programming language developed by?

1.Google

2.Facebook

3.Apple

4. IBM


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

1.TRUE

2.FALSE

3.Can be true or false

4.Can not say


Question:
The IDE Used In Swift Is______

1.Ld

2.Xcode

3.Gas

4.Swiftc


Question:
What are the advantages of Swift?

1.Swift is safe

2.Swift is fast

3.Swift is open source

4.All of these


Question:
What are the collection types in Swift?

1.Swift is which type of language?

2.object-oriented programming language

3.type safe language

4.All of the above


Question:
What are the features of Swift Programming?

1. Arrays and integers are checked for overflow

2. It eliminates the classes that are in an unsafe mode

3.Switch function can be used instead of using “if” statement

4.All of the above


Question:
What is swift playground?

1. Is a algorithmic designer tools

2.Advanced tool to create applications

3.A tool Used to write a pseudo code for any program

4.Powerful programming language created by Apple


Question:
What is the meaning of question mark "?" in Swift?

1.used in function declaration

2.used in property declaration

3.used in loop declaration

4.used in parameter declaration


Question:
What's are the new features in Swift 4.0?

1.Faster, easier to use Strings that retain Unicode correctness

2.Smart key paths for type-safe, efficient, extensible key value coding for Swift types

3.Added some enhancements to creating dictionary and Set types

4.All of the above


Question:
When can mutating methods be used in structs?

1.Inside variables

2.Inside constants

3.When let keyword is used

4.All of the above


Question:
When Swift was initially Released?

1.June 2, 2012

2.June 2, 2013

3.June 2, 2014

4.June 2, 2015


Question:
Which among the following is true with respect to enum's raw values in Swift? S1: Integer raw values are assumed to start at 0 S2: Integer raw values increase monotonically S3: Raw-valued enum automatically conforms to RawRepresentable S4: String raw values cant be synthesized automatically

1.S1,S2 and S3

2.S2 only

3.S2,S3 and S4

4.S1, S3 and S4


Question:
Which command is used to turn the switch on?

1.toggle( )

2.toggleSwitch( )

3.onSwitch( )

4.activateSwitch( )


Question:
Which is false with respect to structs in swift?

1.Structures can adopt protocols

2.structures are passed through copying

3.Structs can be inherited

4.Structures can be compared using identity operator


Question:
Which keyword enables a method of a struct to change the value of the struct itself in swift?

1.mut

2.mutating

3.mutable

4.Nsmut


Question:
Which Of The Following Is Incorrect Data Type In SWIFT ?

1.UInt

2.Double

3.Char

4.Optional


Question:
Which of the following throws error in swift with respect to structs?

1.class MyView: NSView { }

2.struct MyInt: Int { }

3.struct Vector: Hashable { ... }

4.None of the above


Question:
Which operator specifies a range between two values a and b (a

1.full open range

2.half close range

3.full close range

4.half open range


Question:
Who is introduced Swift?

1.Chris Lattner

2.Vikram Adve

3.Steve Jobs

4.Tanya Lattner


More MCQS

  1. Swift Multiple Choice Questions and Answers Set 1
  2. Swift Multiple Choice Questions and Answers Set 2
Search