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

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

1. let, var

2.let, let

3.var, let

4.var, var

Posted Date:-2022-10-29 10:55:26


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

Posted Date:-2022-10-29 10:45:14


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

1.Hash

2.Asterisk

3.Single Slashes

4.Double Slashes

Posted Date:-2022-10-29 10:51:09


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

1. integer number

2.floating numbers

3.decimal number

4.All of the above

Posted Date:-2022-10-29 10:48:43


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

Posted Date:-2022-10-29 10:38:12


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

Posted Date:-2022-10-29 10:35:30


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

1.AppKit Framework

2.UIKit Framework

3.Foundation Framework

4.CoreMotion Framework

Posted Date:-2022-10-29 10:08:28


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

Posted Date:-2022-10-29 10:57:10


Question:
 To Create Mutable Object __ Is Used

1.Let

2.Var

3.Both A&B

4.None

Posted Date:-2022-10-29 12:26:47


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

Posted Date:-2022-10-29 12:28:23


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

Posted Date:-2022-10-29 09:28:31


Question:
 ____________ is a process of querying and calling properties

1.Lazy Chaining

2.Swift Chaining

3.Optional Chaining

4.All of the above

Posted Date:-2022-10-29 09:53:46


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

Posted Date:-2022-10-29 09:33:52


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

1.var, let

2. let, let

3.var, var

4.let, var

Posted Date:-2022-10-29 09:36:30


Question:
Enum is also known as Swift Enumeration.

1.Yes

2.No

3.Can be yes or no

4.Can not say

Posted Date:-2022-10-29 09:35:31


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

Posted Date:-2022-10-29 12:14:18


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

Posted Date:-2022-10-29 09:31:35


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

1.1

2.2

3.3

4.4

Posted Date:-2022-10-29 09:33:08


Question:
IOS Stands For ?

1.Internetwork Operating System

2.IPhone Operating System

3.Internet Operating System

4.None Of Them

Posted Date:-2022-10-29 12:23:44


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

1.decimal number

2. integer number

3. floating numbers

4. None of the above

Posted Date:-2022-10-29 09:51:13


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

1.Google

2.Facebook

3.Apple

4. IBM

Posted Date:-2022-10-29 09:29:28


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

Posted Date:-2022-10-29 09:57:39


Question:
The IDE Used In Swift Is______

1.Ld

2.Xcode

3.Gas

4.Swiftc

Posted Date:-2022-10-29 11:59:00


Question:
What are the advantages of Swift?

1.Swift is safe

2.Swift is fast

3.Swift is open source

4.All of these

Posted Date:-2022-10-29 12:08:39


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

Posted Date:-2022-10-29 12:20:28


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

Posted Date:-2022-10-29 10:05:31


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

Posted Date:-2022-10-29 10:12:28


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

Posted Date:-2022-10-29 09:30:26


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

Posted Date:-2022-10-29 12:11:37


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

Posted Date:-2022-10-29 09:21:47


Question:
When Swift was initially Released?

1.June 2, 2012

2.June 2, 2013

3.June 2, 2014

4.June 2, 2015

Posted Date:-2022-10-29 10:03:42


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

Posted Date:-2022-10-29 09:14:37


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

1.toggle( )

2.toggleSwitch( )

3.onSwitch( )

4.activateSwitch( )

Posted Date:-2022-10-29 10:09:25


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

Posted Date:-2022-10-29 09:16:18


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

Posted Date:-2022-10-29 09:15:22


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

1.UInt

2.Double

3.Char

4.Optional

Posted Date:-2022-10-29 09:56:19


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

Posted Date:-2022-10-29 09:25:15


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

Posted Date:-2022-10-29 09:32:27


Question:
Who is introduced Swift?

1.Chris Lattner

2.Vikram Adve

3.Steve Jobs

4.Tanya Lattner

Posted Date:-2022-10-29 10:01:57


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

Posted Date:-2022-10-29 09:34:45


More MCQS

  1. Swift Multiple Choice Questions and Answers Set 1
  2. Swift Multiple Choice Questions and Answers Set 2
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!