OOP Flashcards

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

Define object

A
  • stores state in field

- behaviour through methods

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

Define attribute

A

defines or describes the object

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

Define class definition

A

blueprint that defines the properties of all objects of the same type

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

Define instantiation

A

process of making an object from the class definition

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

What does UML (Unified Modelling Language) look like

A

contains:

  • name
  • attribute (data type)
  • methods
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Define method

A

operations that the class can execute

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

Define constructor

A

carries out actions that are needed when an instance of the object is created. e.g. initial values

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

Define Encapsulation

A

protects data by bundling the data and methods together within a class

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

What should attributes be declared as

A
  • Private

- hidden within the class

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

What should methods be declared as

A
  • Public

- access or modify attributes (getters and setters)

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

Describe inheritance

A

creating a new child class that inherits the attributes and methods of the parent class

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

What does an inheritance diagram look like?

A

open arrows pointing up to parent

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

Define Polymorphism

A

ability of the system to process objects differently depending on their data type or class

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

Define association

A

relationship between two entirely separate classes

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

Define aggregation

A
  • one-way relationship
  • “has a”
  • open diamond
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Define composition

A
  • one way relationship
  • “is part of”
  • closed diamond
17
Q

Advantages of OOP

A
  • Highly modular classes
  • Easier to maintain
  • Protected data
18
Q

Disadvantages of OOP

A
  • Large amount of memory needed

- Objects can acquire the ability to do things that don’t make sense

19
Q

Define Concrete Class

A
  • A class we can create an instance of
  • a complete class
  • Abstract is opposite (can be subclassed)
20
Q

Define Procedure

A

-Set of instructions that are executed

21
Q

Define Function

A

-Procedure but returns a value