0 votes
in Swift by
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.

A

S1 and S2

B

S1 and S3

C

S2 and S3

D

S1, S2 and S3

1 Answer

0 votes
by
Answer: A

Reason:  Computed properties of swift performs necessary computation each time it is accessed and returns a value rather than storing it. Hence their value can change each time it is called. They are always variables which are build with getter and setter methods using get and set keywords. Default value of the variable should not be assigned. It can be defined by providing the variable name and declare irs type explicity.

Related questions

0 votes
asked Nov 6, 2022 in Swift by rajeshsharma
0 votes
asked Nov 7, 2022 in Swift by Robin
...