Programming Paradigm Flashcards

(16 cards)

1
Q

What is an object

A

a container used to store both data and instruction , it is created from classes using instantiation

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

WHat is a class

A

specify what properties and methods objects of their type would have

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

WHat is a private method

A

Can only be accessed within the class it was declared and nowhere else

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

WHat is a public method

A

a function or procedure within a class that’s accessible and callable from any other part of the program, inside or outside its clas

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

WHat is encapsulation

A

grouping of attributes and methods are stored in the objects /
combining methods and procedures to form an object

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

WHat is inheritance

A

allows one class to share the properties and methods of another class . It “is a “ relationship

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

What is polymorphism

A

WHen objects are processed differently depending on their class

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

WHat is overriding

A

Sane name as a method in an inherited class but different implementation

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

What is association

A

descibed as having a “has a “ relationship

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

WHat is aggregation

A

weaker type of association , it would exists if its containing object is destroyed

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

What is composition

A

The containing object is destroyed , the association object is also destroyed ( stronger relationship)

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

Why is oop used

A

it provides program with clear structure
makes developing and testing easier for developers
Allows large projects to be divided among teams of developers
it improves the space efficency of code

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

List the three design principles used in oop

A

Encapsulate what varies
Favour composition over inheritance
Program to interface , not implementation

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

Explain more on encapsulate what vaaries

A

Any requirement which are likely to change in the future would be encapsulated in a class , this way future changes can be easily made when required

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

Explain more on favour composition over inheritance

A

composition has a more flexible relationship by unrelated classes

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

Explain more on program to interface not inheritance

A

allow unrelated classes to make use of similar methods