Google News
logo
Swift - Quiz(MCQ)
A)
Chris Lattner
B)
Vikram Adve
C)
Steve Jobs
D)
Tanya Lattner

Correct Answer :   Chris Lattner


Explanation : Development of Swift started in July 2010 by Chris Lattner, with the eventual collaboration of many other programmers at Apple. Swift took language ideas "from Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and far too many others to list".

A)
June 2, 2012
B)
June 2, 2013
C)
June 2, 2014
D)
June 2, 2015

Correct Answer :   June 2, 2014


Explanation : Swift is a general-purpose, multi-paradigm, compiled programming language developed by Apple Inc. and the open-source community. First released in June 2, 2014, Swift was developed as a replacement for Apple's earlier programming language Objective-C, as Objective-C had been largely unchanged since the early 1980s and lacked modern language features.

A)
Arrays and integers are checked for overflow
B)
It eliminates the classes that are in an unsafe mode
C)
Switch function can be used instead of using “if” statement
D)
All of the above

Correct Answer :   All of the above

A)
AppKit Framework
B)
UIKit Framework
C)
Foundation Framework
D)
CoreMotion Framework

Correct Answer :   AppKit Framework

A)
toggle( )
B)
toggleSwitch( )
C)
onSwitch( )
D)
activateSwitch( )

Correct Answer :   toggleSwitch()

A)
Is a algorithmic designer tools
B)
Advanced tool to create applications
C)
A tool Used to write a pseudo code for any program
D)
Powerful programming language created by Apple

Correct Answer :   Powerful programming language created by Apple

A)
used in loop declaration
B)
used in function declaration
C)
used in property declaration
D)
used in parameter declaration

Correct Answer :   used in property declaration


Explanation : In Swift, question mark "?" is used in property declaration. It tells the compiler that this property is optional. The property may hold a value or not.

A)
You have to declare a question mark ? in the code to make a property optional
B)
You have to declare a question mark & in the code to make a property optional
C)
You have to declare a question mark ?? in the code to make a property optional
D)
None of the above

Correct Answer :   You have to declare a question mark ?? in the code to make a property optional


Explanation : We have to declare a question mark ?? in the code to make a property optional. If a property doesn't have a value, then the symbol ? helps to avoid the runtime error.

A)
Control
B)
Defined
C)
Parameter
D)
Closure Expression

Correct Answer :   Closure Expression

A)
Optional
B)
Missing
C)
Changed
D)
Necessary

Correct Answer :   Optional

A)
Active
B)
Inactive
C)
Not running
D)
All of the above

Correct Answer :   All of the above

A)
Scripting Language
B)
Type-safe language
C)
Object-oriented programming language
D)
All of the above

Correct Answer :   All of the above

A)
Array and library
B)
Dictionary and array
C)
Dictionary and library
D)
Library, dictionary and array

Correct Answer :   Dictionary and array

A)
stringValue == nil
B)
stringValue == "Somthing"
C)
the compiler won't allow it
D)
None of the above

Correct Answer :   the compiler won't allow it

A)
Quad Literals
B)
Binary Literals
C)
Decimal Literals
D)
Hexadecimal Literals

Correct Answer :   Quad Literals


Explanation :

Quad Literals is not a literals in swift.

A)
integer number
B)
floating numbers
C)
decimal number
D)
All of the above

Correct Answer :   floating numbers


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.

A)
Automatic memory management
B)
Swift follows Objective-C like syntax
C)
Swift is very easy to learn and precise to use
D)
All of the above

Correct Answer :   All of the above


Explanation : All of the above are features of Swift programming language.

A)
Hash
B)
Asterisk
C)
Single Slashes
D)
Double Slashes

Correct Answer :   Double Slashes


Explanation : In Swift programming language, single-line comments are started with double slashes

A)
Dictionary
B)
Regular Expression
C)
Responder Chain
D)
None of the above

Correct Answer :   Responder Chain


Explanation : Responder Chain : Responder Chain is a hierarchy of objects that obtain the opportunity to respond to the events.

A)
let, var
B)
let, let
C)
var, let
D)
var, var

Correct Answer :   let, var


Explanation : Constants are declared by using let keyword and variables by var keyword.

A)
Swift Chaining
B)
Optional Chaining
C)
Lazy Chaining
D)
All of the above

Correct Answer :   Optional Chaining


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.

A)
1
B)
2
C)
3
D)
4

Correct Answer :   2


Explanation : There are two types of classes in Inheritance in Swift : Sub class and Super class

A)
Close
B)
Open
C)
Unsigned
D)
Signed

Correct Answer :   Signed

A)
Aster, easier to use Strings that retain Unicode correctness
B)
Added some enhancements to creating a dictionary and Set types
C)
Smart key paths for type-safe, efficient, extensible key-value coding for Swift types
D)
All of the above

Correct Answer :   All of the above

A)
Ture
B)
False
C)
Can be True or False
D)
Can not say

Correct Answer :   True

A)
Enum
B)
Double
C)
Class
D)
Character

Correct Answer :   Class

A)
Char
B)
UInt
C)
Double
D)
Optional

Correct Answer :   Char

A)
5
B)
4
C)
3
D)
2

Correct Answer :   2


Explanation : There are two varieties of collection types in Swift: Array and Dictionary.

A)
Ld
B)
Xcode
C)
Gas
D)
Swiftc

Correct Answer :   Xcode

A)
Conts
B)
Let
C)
Contants
D)
None Of The Above

Correct Answer :   Let

A)
CMOS
B)
LINUX
C)
UNIX
D)
WINDOWS

Correct Answer :   UNIX

A)
Swiftc Compiler
B)
Objective C Compiler
C)
Contains Both Compiler (swiftc And Objective C)
D)
None of the above

Correct Answer :   Contains Both Compiler (swiftc And Objective C)

A)
Let X=[Int]
B)
Var X=[Int]
C)
Let X =[Int]()
D)
Var X=[Int]()

Correct Answer :   Var X=[Int]()

A)
Tuple
B)
Array
C)
Both (A) and (B)
D)
None of the above

Correct Answer :   Tuple

A)
Break
B)
Continue
C)
Fallthrough
D)
All of the above

Correct Answer :   All of the above

A)
It supports any kind of data, and not only synchronize but also checks for equality
B)
Switch statement must be exhaustive, which means that you have to cover all possible values for your variable
C)
When a case is matched in switch, the program exits from the switch case and does not continue checking the next cases. So you don’t need to explicitly break out the switch at the end of case
D)
All of the above

Correct Answer :   All of the above