Object Oriented Programming Flashcards

Question 1: OOP

1
Q

Selection

A

Conditional Statements (“if” statements)

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

Choices

A

When “if” statements hs “else” it becomes a choice

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

Iteration

A

Doing something more than once (using “for”, “do”, “while)

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

Structured Code

A

Any combination of sequence, selection, and iteration

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

Procedural Code

A

Procedures address a problem with structured code

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

Problems with Global Variables

A

Is it safe to use?

Where did the values come from?

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

Subroutines

A

Reducing duplication of code within a program

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

Global Variables

A

a variable type that is declared outside any function and is accessible to all functions throughout the program

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

Object-Oriented Programming

A

Model the world as objects.

Objects can send “messages” to each other.

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

Static Fields

A
A static field belongs to the class
Do not change from one instance to the other
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Static Methods

A
Do not need to create an object of the class in order to
call the method. Can be called through the class name
"Classname.staticmethod();"
or "staticmethod()" if in the same class
Can not be overridden
Can only call other static methods
Only access static fields
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Class

A

Group of objects with similar attributes or behaviour

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

Final Class

A

A final class cannot be subclassed

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

Final Methods

A

A final method cannot be overridden or hidden by subclasses

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

Final Variable

A

Can only be initialised once

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

Association

A

Represents a general relationship that describes an activity between two classes

“uses”

if class A uses class B, then one ore more methods of class B will be invoked by class A (from one or more methods in class A).

17
Q

Aggregation

A

Aggregation is a special type of association. That is, a class that is defined in part by another class is dependent on that class.

“has a” relationship or “made of”

18
Q

Composition

A

An aggregation relationship that implies a child cannot exist independent of the parent.

19
Q

Inheritance

A

“is an extension of” relationship.

Manager and secretary are extensions of employee

20
Q

Inheritance vs Aggregation

A

A dog is an animal (inheritance) (is a)

A person cannot exist without a name (aggregation) (has a)

21
Q

Polymorphism

A

The ability of an object to take on many forms. Often seen with a parent/child relationship between classes.

22
Q

Method Overloading

A

a feature that allows a class to have more than one method having the same name, if their argument lists are different.