topic 10 Flashcards

1
Q

base class

A

A class whose attributes (properties) and behaviors (methods) are
inherited
Example: A

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

Derived class

A

A class that inherits attributes (properties) and behaviors (methods) from
another class
Example: B/C

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

An attribute

A

These are defined as variables of the appropriate type

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

A behaviour

A

These are defined as functions with appropriate parameters

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

Describe 2 benefits of inheritance

A

Objects/code can be re-used
New code is needed only for additional methods, this increases productivity
This reduces development time

The base class will already have been tested
Only the derived class new methods require testing
This reduces testing time

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

What’s an object

A

A self-contained component design relating to a real-world object that is constructed from a class.
It describes the details of the object including data or properties and functions
Is an instance of a class

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

What’s a method

A

A section of code contained within a class
It defines an action that an object of that class can perform
Methods only have access to data within their own class

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

What’s a class

A

A template that specifies the properties and method that relate to a real-world object

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

It’s claimed that the object-oriented approach is an effective way of developing software.

A

Object-oriented programming uses the concept of self-contained objects,
which contain both program routines and the data being processed.

Advantages:
Classes and methods created for one object-oriented application can be
reused
Once an object is created it can be used without knowledge
of how it is coded
Due to its modular nature, there is an extensive design/planning stage
resulting in less maintenance

Disadvantages:
A steep learning curve as encapsulation and inheritance can be difficult to
understand

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