Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

Encapsulation and abstraction

hI,

How is Encapsulation is different/similar from abstraction. Both seems almost same to me. when and where and how to use each one in the real world

Please advise
Any links resources ideas highly appreciated. Thanks in advance
SOLUTION
Avatar of girionis
girionis
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

ASKER

I can relate well now EncaPsulation with Private
ABSTRACTion with ABSTRACT classes, interfaces and jdbc interface concept

>>They both  achieve the same thing , but the purpose is different


eventhough same thing does the path/way to achieve the purpose is same or different?

private methods could be abstract and vice versa right.

Practically can we use both encapsulation and abstraction together same time?

Please advise
Encapsulation and abstraction go together - usig a class itself means encapsulation.
Now, these are OO concepts . You still have to read my answer and think about it more and more.

The purpose of making a method abstract is to let subclasses override and implement it . Making it private would not allow the subclasses to acces it .So, you can't have a private abstract method.