Interviewer And Interviewee Guide

Swift Developer Interview Question:

Explain me what Is The Significance Of “?” In Swift?

Submitted by: Muhammad
The question mark (?) is used during the declaration of a property. If the property does not hold a value, the question mark (?) helps to avoiding application errors.

Example looks like -

class Employee {

var certificate : [Certificates]?

}

let employee = Employee();

Example 2 -

let middleName : String? = nil

let lastName : String = "Muhammad"

let name : String = middleName ?? lastName
Submitted by: Muhammad

Read Online Swift Developer Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.