Object Oriented Programming Flashcards
What does the (+) symbol tell us in a diagram?
An instance variable or method is public.
This means it can be fully accessed and used by other objects.
What does the (-) symbol show us in a UML diagram?
That an instance variable or method is private.
This means it cannot be directly accessed or used by other objects.
What is the purpose of encapsulation?
To make changes to private properties using the methods provided.
What is a sub-class?
A class that is derived from an existing class.
What is the purpose of inheritance?
To copy all of the data items and methods from the superclass when a sub-class is created.
What does polymorphism allow?
Different sub-classes and the superclass they are derived from to behave differently when the same method is invoked.
What does an array of objects allow in OOP?
An instance variable to become an array which contains several instances of another class.