Objected-orientated programming Flashcards

1
Q

Objects:

A

Instances of classes that encapsulate data and behaviour.

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

Classes:

A

Blueprint or template for creating objects.

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

Inheritance:

A

A mechanism for creating a new class that is a modified version of an existing class.

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

Polymorphism:

A

The ability of objects to take on multiple forms, often achieved through method overloading and overriding.

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

Encapsulation:

A

Bundling of data and methods that operate on the data within a single unit (class).

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

Attributes (Properties):

A

Variables that store data in a class.

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

Methods (Functions):

A

Functions that perform actions within a class.

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

class example
(Creation)

A

class Car:
def __init__(self, make, model):
self.make = make
self.model = model

def display_info(self):
    print(f"{self.make} {self.model}")
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a setter

A

A setter is a special type of method that sets one of the attributes equal to a special value

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

What is a Getter method

A

A getter is a special type of method that obtains the value of one of the attributes of the object.

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