Object oriented programming Flashcards

1
Q

How to create a class?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do a subclass?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How to do a initializer in a subclass?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How to declare a computed variable?

A
  • They have to be var

var area: Double {

return length * width

}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a value type?

A
  • A struct is a value type
  • It is a type whose value is copied when it is assign to a variable, constant or passed to a function as parameter.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a reference type?

A
  • A class is a reference type
  • It is a type whose value is not copied when it is assign to a variable, constant or passed to a function as parameter. Instead a reference to the instance is created
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a designatd initializer?

A
  • It is the initializer that must be used when creating an instance of th class
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a convenience initializer?

A
  • It is used when you want to give determined values to the properties of an instance that is a sublcass.
  • It can only call the designated initializer of its class not the super.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly