Hi, have you tried Google or Wikipedia or books you have on hand? If you can describe what you think they mean, we'll talk about what you have, but we're not likely to do the whole job for you. Let us know what you find!
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Abstraction: For example, A 'Person' is not an 'Animal'. We can prove it by abstraction. Drawing a line and Defining an Object's Property and Behaviour is Abstraction.
Encapsulation: After drawing a line and defining the properties and behaviour, now Hidding internal details of particular behaviour and hidding certain properties is encapsulation. Example: if you kick a dog he bites. This is the behaviour of a dog and we should be least bothered about how he will bite rather should be conceren about the fact that if we kick him, he bites.
This is my understanding about these concepts. May this helps.
An abstract class doesn't have any body. It's an "agreement" that the class (where this abstract class is implemented) is going to use all the methods of abstract class. It it does not do so then that also has to be an abstract class.
On the other hand, encapsulation is hiding the program logic from the end-user. Using encapsulation improves the security and privacy of the system.
For more understanding, I suggest you read a good object oriented text book.
Joined: Jun 11, 2007
subject: difference between abstraction and encapsulation