Computer Science, asked by ananthmariswamy7416, 10 months ago

What is the encapsulation in the c++ explain with program?

Answers

Answered by Ravispssbp
1

Answer:

Please MARK BRAINLIST

Encapsulation is a process of combining data members and functions in a single unit called class. This is to prevent the access to the data directly, the access to them is provided through the functions of the class. It is one of the popular feature of Object Oriented Programming(OOPs) that helps in data hiding.

:

Encapsulation Example in C++

Here we have two data members num and ch, we have declared them as private so that they are not accessible outside the class, this way we are hiding the data. The only way to get and set the values of these data members is through the public getter and setter functions.

HOPE IT WILL HELP YOU

THNX.....

Answered by Anonymous
3

Answer:

Please MARK BRAINLIST

Encapsulation is a process of combining data members and functions in a single unit called class. This is to prevent the access to the data directly, the access to them is provided through the functions of the class. It is one of the popular feature of Object Oriented Programming(OOPs) that helps in data hiding.

:

Encapsulation Example in C++

Here we have two data members num and ch, we have declared them as private so that they are not accessible outside the class, this way we are hiding the data. The only way to get and set the values of these data members is through the public getter and setter functions.

HOPE IT WILL HELP YOU

THNX.....

Similar questions