Class Flashcards
1
Q
Where would you find a class name
A
At the top of the diagram
2
Q
Why does a constructor method do
A
Initialises a instance if the object with the correct properties
3
Q
What is encapsulation
A
Setting variables to public and private to prevent data being changed
4
Q
What is a private variable
A
One that is only accessible withing the object and dot for notation
5
Q
What is a method
A
A function the object can perform
6
Q
What is inheritence
A
When a object gets the properties and methods of another class becoming a sub-class of the class
7
Q
What is polymorphism
A
This is when a method is changed in a sub-class to overwrite the method in the class