OOP Flashcards

(9 cards)

1
Q

What is a class

A

Template for an object

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

Instantiation

A

Process of creating objects through classes

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

Object

A

Instance of a class

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

Setter

A

method that sets the value of a particular attribute

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

Getter

A

Retrieves the value of the given attribute

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

Encapsulation

A

Ensures attributes cannot be directly accessed and edited by users

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

Constructor

A

Allows a new object to be created

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

Setter example code

A

public function set_score()
score = 0
end function

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

Getter example code

A

public function get_score()
return score
end function

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