OOP Flashcards

1
Q

Define Paradigm

A

Style of programming

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

What is procedural programming?

A

Each variable, constant, function is defined separately, no inherent relationship.

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

What is a class?

A

A template for creating a type of object.

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

What is a object?

A

An instance of a class.

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

What is OOP?

A

Each variable, function is associated with an object, this allows for values and subroutines to be easily group together.

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

What is a static attribute?

A

An attribute shared by all objects of a class.

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

What is encapsulation?

A

Grouping of data and subroutines via use of classes.

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

Why is encapsulation used?

A

To make error identification easier and to increase security by preventing access to variables/subroutines by other parts of the program.

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

What is an accessor?

A

A method which returns the value of a private attribute.

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

What is an mutator?

A

Methods which alter the value of a private attribute.

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

What is inheritance?

A

The copying of attributes and methods from one class to another.

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

What is abstract class?

A

A class with declared methods without specified functionality.

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

Why use abstract classes?

A

When all children classes require the method but with different implementations.

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

What happens when a class calls a super method?

A

It accesses the method called in its parents.

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

What is polymorphism?

A

The allowance of multiple methods to have the same name but different implementation.

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

What is overriding?

A

A polymorphism method. It allows a child to override the method of its parent. The virtual keyword may be needed to be overriden.

17
Q

What is overloading?

A

A polymorphism method. It allows for multiple methods with the same name but different parameters to be used.

18
Q

Why use polymorphism?

A

Allows the reuse of method names, making code easier to make and understand.

19
Q

UML private

A

-

20
Q

UML public

A

+

21
Q

UML protected

A

#

22
Q

UML static

A

underline

23
Q

UML abstract

A

italics

24
Q

UML order

A

Name, Attributes, Methods

25
Q

What is composition?

A

A class association where the existence of component objects is dependent on the composite object. BLACK DIAMOND.

26
Q

What is aggregation?

A

A class association where the existence of component objects is independent on the composite object. WHITE DIAMOND.