Flash Games

 FAQ   Search   Members   Groups   Register  User Control Panel      Login 

Your time now:
Mon Nov 23, 2009 11:45 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ]  Bookmark and Share
Author Message
 Post subject: what is the difference between Encapsulation and Abstraction
PostPosted: Thu Apr 05, 2007 1:45 pm 
Offline

Joined: Wed Mar 28, 2007 1:56 pm
Posts: 3
Location: pune
What is the difference between Encapsulation and Abstraction,Tell me real time examples.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 17, 2007 5:05 am 
Offline

Joined: Tue Apr 17, 2007 4:30 am
Posts: 45
Location: !!!!!MéXiCo¡¡¡¡¡¡
Encapsulation is when you can use diferents tool from a single object in your program.

for example: Obj o=new Obj();
o.sum(); o.divide() and everything inside the same object.

Abstraction is when you simplify a complicate proccess with a few statement.

for example: o.solveEquation(2,3,5)

with this i wont need to complicate my life every time i need it.

it is encapsulated because its inside an object and its abstract beacause i dont really need to know how to resolve equations.

A good tutorial will do a better job, this is to make the understanding easier.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 09, 2007 12:25 pm 
Offline

Joined: Wed May 09, 2007 10:51 am
Posts: 6
Abstaction is selective ignorance where in if you come across a common functionlaity in in any system which differs in some of details which are specific to those particular objects and overall most of the functionlait is common.. So you abtact out all such common functionlaity and put it in one place and just change the functionlaity for specifics. Go through the very draw ,shape , rectangle example from any basic book..

class Person {
private final Date birthdate = ...;

long calculateAge() {
return System.currentTimeMillis() - birthdate.getTime();
}
}



Simplified, this would rather be encapsulation.

_________________
:)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group - Flash Games - TNX Invitation Code - TNX Review


Webmaster - Excruciating - Johnathan - Kotik - Ash - Tomi - rangana - Phate - dflynn - Medley