Computer Science, asked by Wadhwanipk904, 1 year ago

Difference between data abstraction and data encapsulation

Answers

Answered by sikhi
5
Encapsulate hides variables or some implementation that may be changed so often in a class to prevent outsiders access it directly. They must access it via getter and setter methods.

Abstraction is used to hiding something too but in a higher degree(class, interface). Clients use an abstract class(or interface) do not care about who or which it was, they just need to know what it can do.

hope it helps you
Answered by kavitasingh1234
2

\huge\bold\red{ᴀɴՖᴡᴇʀ}

Data Encapsulating:-

  • The data is not accessible to the outside world they can be accessed only by its method,which are wrapped within the class.
  • The wrapping up of data and member function into single unit is called encapsulating.
  • Data encapsulating is the most important feature of the class.
  • The process of protecting data from direct access by the program is called data hiding or information.

Data Abstraction:-

  • Abstraction refers the act of representing essentially feature where no background details are explained.
  • Data Abstraction helps in clear separation between the abstract properties and the details of its implementation.

example \\

we need basic options for starting the computer like shutting down and knowledge to use the peripherals.

we need not know the internal functioning or the complex architecture of the system.

Similar questions