Week 8 Flashcards

1
Q

is defined as the wrapping up of data and information in a single unit. It is defined as binding together the data and the functions that manipulate them.

A

Encapsulation

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

What are the two important property of Encapsulation

A

Data Protection
Information Hiding

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

Encapsulation protects the internal state of an object by keeping its data members private. Access to and modification of these data members is restricted to the class’s public methods, ensuring controlled and secure data manipulation.

A

Data Protection

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

Features of Encapsulation

A

*We can not access any function from the class directly. We need an object to access that function that is using the member variables of that class.
*The function which we are making inside the class must use only member variables, only then it is called encapsulation.
*If we don’t make a function inside the class which is using the member variable of the class then we don’t call it encapsulation.
*Encapsulation improves readability, maintainability, and security by grouping data and methods together.
*It helps to control the modification of our data members.

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

Encapsulation hides the internal implementation details of a class from external code. Only the public interface of the class is accessible, providing abstraction and simplifying the usage of the class while allowing the internal implementation to be modified without impacting external code

A

Information Hiding

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

also leads to data abstraction.

A

Encapsulation

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

also hides the data, as in the above example, the data of the sections like sales, finance, or accounts are hidden from any other section. To understand how to implement encapsulation effectively in C++, check out the C++ Course, which provides detailed explanations and examples.

A

Encapsulation

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

means that the member function or data member can only be accessed by other member functions of the same class.

A

Private

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

means that the member function or data member can be accessed by other member functions of the same class or by derived classes.

A

Protected

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

means that the member function or data member can be accessed by any code.

A

Public

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