Chapter 27 Object-oriented Progrmamming (OOP) Flashcards

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

What is a class?

A

A class is a type or a blueprint for creating objects that has a record containing its attributes which are declared as private and has methods outside the record declared as public that operate on the attributes.

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

What are attributes?

A

Attributes are data items of a class

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

What are methods?

A

Methods are subroutines of a class that act on the data in the record

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

What is an object?

A

An object is an instance of a class, for example
Object: MyCourse
Type: Course
An object becomes a course type if MyCourse = Course(“English”)

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

What happens in encapsulation?

A

The methods operating, using or editing the attributes

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

What is a constructor?

A

A constructor is a method that instantiates(impersonates) a new object.

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

In what can we show a class, its attributes and methods?

A

We can represent a class, its attributes and methods in a class diagram.

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

What is polymorphism?

A

Polymorphism is a behaviour of a code when reacting to different classes in the hierrarchy

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

What is a containment?

A
Containment is a relationship between two classes where one class has a component that is of the other class type. 
Can be represented using a containment diagram
How well did you know this?
1
Not at all
2
3
4
5
Perfectly