objects Flashcards

1
Q

What are the two methods of programming that is in use today? Which one was the earliest?

A

Object oriented programming

Procedural programming. The procedural.

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

What is procedural programming focused on?

A

on creating functions/procedurals

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

What is object oriented programming centered on?

A

on creating objects.

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

What is an object?

A

A software entity that contains both data and procedures.

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

data attributes. What does it do?

A

Data contained in the object is known as data attributes. It references data

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

Methods. They perform operations on?

A

The procedure that object performs on. On data attributes.

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

What problem does OOP address.

A

Code and data separtaion.

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

How does it address the problem?

A

through encapsulation and data hiding.

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

What is encapsulation?

A

The process of combining the data and code into a single object.

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

What is data hiding?

A

It is the object’s ability to hide the data attributes from code outside the object.

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

Who may access data attributes?

A

ONLY the object’s methods may directly access and makes changes to the data attributes

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

Why is an object’s internal data usually hidden from outside the code.

A

data attributes are protected from accidental corruption.

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

OOP encourages?

A

Code reusability.

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

In order words data attributes in an object are ?

A

private.

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

What are public methods?

A

The methods that can be accessed by entities outside the object

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

What is a class?

A

A class is a code that specifies data attributes and methods for a particular type of object.

17
Q

To create a class what do you do?

A

write a class definition

18
Q

Define class definition

A

A set of statements that define a class’ method and data attributes.

19
Q

the __init__ method aka?

A

initializer method as it initializes the object’s data attributes.

20
Q

how to hide data?

A

self.__hide