OOP Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Define a Class

A
A definition 
(or blueprint) of an object, its methods and its behaviours
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Define an Object

A

An entity defined by its attributes and methods. (The entity modelled. Like a car.)

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

Define Instantiation

A

Creating software objects from class definitions

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

Define Encapsulation

A

Making the attributes of a class private, only allowing it to be shown through methods.

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

Define a reference variable

A

A variable set to an instance of an object

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

Define inheritance

A

When one class (child) receives some of the attributes and methods of an existing class (parent)

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

Define Overriding

A

When a method is changed and overwritten by a child class

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

Define Association

A

When 2 classes are not inherited from one another, but have a relationship to one another.

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

Define Aggregation

A

When the 2 classes can exist without each other

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

Define Composition

A

When one class cannot exist without another.

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

What does the phrase: “Favour composition over inheritance” mean?

A

Inheritance can be complex and allow too much to be inherited; composition is often more realistic and pragmatic

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

What does the phrase “Encapsulate what varies” mean?

A

Use private attributes & public methods

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

What does the phrase “Program to interfaces, not implementation” mean?

A

Interface provides an abstraction, hides complexities of system from a user and can have different implementations for the same interface

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

Define Polymorphism

A

When a method of a child and parent class is the same, but the behaviour is different

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

Define a class definition

A

Template or blueprint used to define object

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

Define a stack frame

A

Used to store the values of parameters and local variables and the return address when another routine is called so that it can return correctly

17
Q

Define Object Oriented paradigm

A

Combines methods (subroutines) and attributes (data) into a class definition

18
Q

Define Procedural paradigm

A

Code that is structured into subroutines; each subroutine carries out a distinct task and data is shared through parameters and return values.