GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Tech FAQs  >  OOPS
Go To First  |  Previous Question  |  Next Question 
 OOPS  |  Question 234 of 258    Print  
difference between data encapsulation vs abstraction

  
Total Answers and Comments: 9 Last Update: October 12, 2009     Asked by: Manpreet kaur 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: sabrish
 
Encapsulation is nothing but hiding information also called datahiding...
while abstraction denotes the essential characteristics of an object which differentiates from other kinds of object...

Above answer was rated as good by the following members:
sripudi, mandeepx81
August 28, 2006 03:51:38   #1  
mani        

RE: difference between data encapsulation vs abstracti...
Abstraction is achieved through encapsulation..Abstraction solves the problem in the design side while encapsulation is theimplementation.
 
Is this answer useful? Yes | No
November 01, 2006 00:05:05   #2  
bijal Member Since: January 2006   Contribution: 6    

RE: difference between data encapsulation vs abstracti...

Abstraction is virtual class design.

Before actually defining class developer will think about what all properties methods and event will be there in my class.

Whereas encapsulation is data hiding.

At the time of class defenation developer will think about which should display to end user and which should not.

In Short Abstraction is Collection of data and Encapsulation is Exposure (or grouping) of data in appropriate access specifier .


 
Is this answer useful? Yes | No
February 20, 2007 07:34:42   #3  
Abhi        

RE: difference between data encapsulation vs abstracti...
Abstraction means datahideing.That means we use the object wethout knowing the source code of the class.

Encapsulation is a mechanism by which we desigm our class such a way that if we change our class in fuature we dont need to change the classes which are depending on our classes.

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 2Overall Rating: -1    
November 27, 2007 11:23:46   #4  
sabrish        

RE: difference between data encapsulation vs abstracti...
Encapsulation is nothing but hiding information also called datahiding...
while abstraction denotes the essential characteristics of an object which differentiates from other kinds of object...

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
November 11, 2008 01:34:14   #5  
dinu_26 Member Since: November 2008   Contribution: 5    

RE: difference between data encapsulation vs abstraction
Abstraction is used for hiding the unwanted information and giving revelant information.

Eg: Three set of customers are going to buy a bike First one wants information about the style. Second one wants about the milage. Third one wants the cost and brand of the bike.So the salesperson explains about the product which customer needs what. So he hiding some information and giving the revelant information.

Encapsulation is combines one or more information into a component.

Eg: Capsule is mixed with one or more medicine and packed into the tube. so its related and acting in two moducles.

 
Is this answer useful? Yes | No
March 04, 2009 23:39:20   #6  
anjali4788 Member Since: February 2009   Contribution: 1    

RE: difference between data encapsulation vs abstraction
Abstraction is the representation of data that how we represent it whereas encapsulation is hiding of unnecessary details from user.
 
Is this answer useful? Yes | No
July 11, 2009 09:18:11   #7  
PNVRKPrasad Member Since: July 2009   Contribution: 4    

RE: difference between data encapsulation vs abstraction
Encapsulation and abstraction both solve same problem: Complexity; but in different dimensions.


Abstraction: Hides the implementation details of your methods. Provides a base to variations in the application which can grow over a period of time.


Encapsulation: Hides the private data elements of the class and exposes only the required things to the clients.


Both are powerful; but using abstraction require more skills than encapsulation and bigger applications/products can not survive with out abstraction.


 
Is this answer useful? Yes | No
September 03, 2009 07:17:06   #8  
mandeepx81 Member Since: September 2009   Contribution: 1    

RE: difference between data encapsulation vs abstraction
It is wrong to call Encapsulation as only data hiding. Though this defination is usually taught in school but now according to latest OOPs principles its considered incomplete.


According to the book Design Patterns Explained

At conceptual level:

Encapsulation means any type of hiding. It can be either data behaviour implementation or derived classes or any other thing.

Abstraction means to generalize or conceptualize: to step back from the more concrete to the more conceptual or abstract.

At implementation level:
Encapsulation is achieved by inheritance aggregation or composition.

Abstraction is represented by using abstract classes to represent a generalized version of set of related classes.

 
Is this answer useful? Yes | No
October 12, 2009 02:32:19   #9  
rajeshspandian Member Since: September 2006   Contribution: 1    

RE: difference between data encapsulation vs abstraction
Encapsulation is wrapping up the data into a single unit (classes).

Abstraction is something like data Hiding.

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape