Question
1 Check all of the true statements regarding the difference between classes and structs . A. Copies of a class instance create a reference to
1 Check all of the true statements regarding the difference between classes and structs.
A. Copies of a class instance create a reference to the instance so both variables will point to the same instance in memory.
B. Copies of a struct instance create a copy of all the data in the instance so both variables have independent data.
C. Structs allow inheritance and override.
D. Class instances cannot be copied.
E. Memberwise initializers are NOT automatically created for classes.
F. Struct instances cannot be copied.
G. Classes do not require initialization but structs do
2. When a class provides its own implementation of a property or method this is known as a(n)...
A. instance.
B. initializer.
C. custom initializer.
D. subclass.
E. override.
F. base class.
3. In Swift, to define custom logic for properties set during the creation of an instance, you must create one or more functions named __________ within your struct or class.
A. the class or struct name
B. return
C. construct
D. init
E. class
F. set
G. struct
4. In Swift, a function that runs to create an instance is called a(n)...
A. mutator.
B. constructor.
C. initializer.
D. method.
E. property.
5 The two observers that can be defined on a property of a class or struct are...
A. mutating and static.
B. String and Double.
C. self and this.
D. var and let.
E. struct and class.
F. Int and Double.
6 A computed property is...
A. a property that is not saved as the value of the instance but is calculated when it is referenced.
B. a property that has no known type.
C. a property that is mutable.
D. a method.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started