OOP Flashcards
Define Paradigm
Style of programming
What is procedural programming?
Each variable, constant, function is defined separately, no inherent relationship.
What is a class?
A template for creating a type of object.
What is a object?
An instance of a class.
What is OOP?
Each variable, function is associated with an object, this allows for values and subroutines to be easily group together.
What is a static attribute?
An attribute shared by all objects of a class.
What is encapsulation?
Grouping of data and subroutines via use of classes.
Why is encapsulation used?
To make error identification easier and to increase security by preventing access to variables/subroutines by other parts of the program.
What is an accessor?
A method which returns the value of a private attribute.
What is an mutator?
Methods which alter the value of a private attribute.
What is inheritance?
The copying of attributes and methods from one class to another.
What is abstract class?
A class with declared methods without specified functionality.
Why use abstract classes?
When all children classes require the method but with different implementations.
What happens when a class calls a super method?
It accesses the method called in its parents.
What is polymorphism?
The allowance of multiple methods to have the same name but different implementation.