OOP Flashcards
(9 cards)
1
Q
What is a class
A
Template for an object
2
Q
Instantiation
A
Process of creating objects through classes
3
Q
Object
A
Instance of a class
4
Q
Setter
A
method that sets the value of a particular attribute
5
Q
Getter
A
Retrieves the value of the given attribute
6
Q
Encapsulation
A
Ensures attributes cannot be directly accessed and edited by users
7
Q
Constructor
A
Allows a new object to be created
8
Q
Setter example code
A
public function set_score()
score = 0
end function
9
Q
Getter example code
A
public function get_score()
return score
end function