answersLogoWhite

0


Best Answer

Encapsulation wraps up data and functions under a single unit and ensures that only essential features get represented without representing the background details which is nothing but abstraction. Therefore, encapsulation is a way of implementing abstraction

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

8y ago

Encapsulation is hiding the details of the implementation of an object so that there are no dependancies on the particular implementation.

Abstraction is removing some distinctions between objects, so as to showing their commonalities

Encapsulation is wraping data into single unit (eg. class)

Abstraction is hiding unessential parts and showing only essential data.

(eg. student class- name, age are essential parts while height, weight are not essential, so hiding information of height and weight)

This answer is:
User Avatar

User Avatar

Wiki User

16y ago

Abstraction is the process of generalizing the definition of an object, and in so doing making a concise, if generalized, interface implementation definition. An abstract class is a partially implemented class that must be inherited and its implementation completed before it can be instantiated. The abstract class when referenced externally infers a degree of implementation but might not infer its implementation detail. Encapsulation is the process of implementing the abstract class.

This answer is:
User Avatar

User Avatar

Wiki User

10y ago

They are related only insofar as they are both key concepts of object-oriented programming (polymorphism and inheritance being the other two).

Encapsulation relates to the way in which an object is a self-contained entity combining data and the methods that operate upon that data. All the information required to use the object is contained within the object itself, hence the object is encapsulated, in much the same way that an egg encapsulates all the information required to produce a chick. Note that the word encapsulation derives from the word capsule, which is an apt description for an egg.

Abstraction relates to the way in which it is not necessary to know how an object is physically implemented in order to use it. This makes it possible to alter the specific implementation within the object without affecting the consumers of that object, provided the abstract interface remains exactly the same. This limits the scope of those changes to the object code itself, thus reducing maintenance. In other words, the interface itself provides a layer of abstraction between the consumer and the information contained within the object. Note that although abstraction is also known as data hiding or information hiding, there is no such feature in C++, nor indeed any object-oriented language. You can certainly limit exposure to certain features of an object by using the private or protected access keywords, but this only limits accessibility to those features, it does not physically hide anything. Think of private data as simply being contained in a cage rather than in a locked box; it is still clearly visible, but access to it is limited to just those members that have the key.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

both are object oriented concepts.encapsulation is a way in which data and code are binded together and data used within the program in kept safe from outside manipulation by making the instance variable private(access modifier) and providing the get method to only access the data(instance variable) so your original data cannot be changed.

abstraction means only showing the necessary part of the program and hiding the details of the program.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

They are both two totally different concepts. Encapsulation is about hiding implementation details whereas Inheritance is about re-using code.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How encapsulation and abstraction are interrelated?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

3 pillars of object oriented programming?

abstraction, inheritance, encapsulation, and polymorphism.


Is encapsulation a characteristic of procedural or object oriented programming?

Encapsulation is one of the four pillars of object-oriented programming. The other three are inheritance, polymorphism and abstraction.


Can abstraction encapsulation be achieved in C program if yes explain?

abstraction and encapsulation is one of the concepts of OOPs and C is not an OOP [Object Oriented Programming language] obviously abst & encap will not be supported by 'C' Abstraction & encapsulation is a concept of OOP [Object Oriented Programming] But, 'C' is not an OOP whereas it is a POP [Procedure oriented programming], so obviously 'C' does not support abstraction and encapsulation Answer Encapsulation is not inherently supported but it can be emulated in C. The use of static and extern keywords for functions are almost equivalent to your private and public keywords in java (encapsulation). Read up more on those keywords.. Structures become an object's attributes while functions accepting pointers the the said struct become its methods.


Basic concepts of OOP?

The four main pillars of all OOP languages are encapsulation, inheritance, polymorphism and abstraction.


What is abstraction method in java?

Abstraction in Java or Object oriented programming is a way to segregate implementation from interface and one of the five fundamentals along with Encapsulation, Inheritance, Polymorphism, Class and Object. Abstraction in Java is achieved by using interface and abstract class in Java.

Related questions

3 pillars of object oriented programming?

abstraction, inheritance, encapsulation, and polymorphism.


What are the benefits and application of OOP?

Encapsulation, inheritance, polymorphism and abstraction.


What are the characteristics of OOPS?

Data Encapsulation, Abstraction, Inheritance, Polymorphism


What are components of object oriented programming?

abstraction,encapsulation,inheritence,polymorphism,object


Is encapsulation a characteristic of procedural or object oriented programming?

Encapsulation is one of the four pillars of object-oriented programming. The other three are inheritance, polymorphism and abstraction.


What are different properties provided by Object-oriented systems?

Polymorphism,Inheritence,Abstraction and Encapsulation


What are the basic concept of object oriented programming language?

Inheritance Encapsulation Polymorphism Abstraction


Can abstraction encapsulation be achieved in C program if yes explain?

abstraction and encapsulation is one of the concepts of OOPs and C is not an OOP [Object Oriented Programming language] obviously abst & encap will not be supported by 'C' Abstraction & encapsulation is a concept of OOP [Object Oriented Programming] But, 'C' is not an OOP whereas it is a POP [Procedure oriented programming], so obviously 'C' does not support abstraction and encapsulation Answer Encapsulation is not inherently supported but it can be emulated in C. The use of static and extern keywords for functions are almost equivalent to your private and public keywords in java (encapsulation). Read up more on those keywords.. Structures become an object's attributes while functions accepting pointers the the said struct become its methods.


What are the impacts of encapsulation in abstraction and information hiding?

It confounds what has been confounded It confounds what has been confounded


What is oops.explain briefly the elements of oops?

if any system supports for abstraction,encapsulation,inheritance and polymorphism.


What is data abstraction in c sharp?

Abstraction means that all information exist but only the relevent information is provided to the user. Encapsulation assists abstraction by providing a mean of suppressing the non-essential details.


What are the features of object oriented program?

The features of object oriented programming are Abstraction, Encapsulation, Polymorphism & Inheritance