(4) Object Oriented Programming Flashcards

1
Q

Definition Class

A

Code representation of an idea that exists in real life.

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

Definition Object

A

An object is an instance of a class. Classes are the blueprints for objects.

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

Definition Attribute

A

Each object contains one or multiple attributes that define the state of the object.

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

Definition Constructor

A

Constructors are helper methods of classes and are called whenever an object is created.

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

What is the keyword this used for?

A

It is used to avoid confusing if a parameter in a constructor and the variable of a class have the same name.

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

What is the keyword to create a new object?

A

new

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

Encapsulation Definition

A
  • Attributes and methods are encapsulated in an object which offers them to other objects via its interface
  • Objects can be used as black boxes (we only know what algorithm does not how it is implemented)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly