Computer Science, asked by dhathrinaiduadapala, 23 days ago

what is encapsulation

Answers

Answered by suneelmourya333
0

Answer:

In object-oriented programming, encapsulation refers to the bundling of data with the methods that operate on that data, or the restricting of direct access to some of an object's components.

Mark me Brainlist

Keep smiling :)

Attachments:
Answered by stefangonzalez246
1

Answer:

  • Technically in encapsulation, the variables or data of a class is hidden from any other class and can be accessed only through any member function of its own class in which it is declared.
  • As in encapsulation, the data in a class is hidden from other classes using the data hiding concept which is achieved by making the members or methods of a class private
  • the class is exposed to the end-user or the world without providing any details behind implementation using the abstraction concept, so it is also known as a combination of data-hiding and abstraction.
  • Encapsulation can be achieved by Declaring all the variables in the class as private and writing public methods in the class to set and get the values of variables
Similar questions