Abstraction (from the Latin abs, meaning away from).
Abstraction is the feature of OOPS in which we show the essential features of an object and suppress the unnecessary details. Personally I think abstraction cannot achieved without Encapsulation, before this you should have the concept of Encapsulation.
Lets understand by daily routine example
Suppose we have created a Bank class and its having one of the methods called getInterest() which will return the interest of particular user. Now whenever we would like to know the interest of particular account holder will simple call this methods, we are not interested how the interest is calculated + what all operations or formulas its using and all we are simple interested in the result that is to [show only the necessary details without including the background details.
By Definition "Abstraction is the way to do work without knowing how is this happening"
it is the headache of method to perform corresponding task.
Abstraction is the feature of OOPS in which we show the essential features of an object and suppress the unnecessary details. Personally I think abstraction cannot achieved without Encapsulation, before this you should have the concept of Encapsulation.
Lets understand by daily routine example
Suppose we have created a Bank class and its having one of the methods called getInterest() which will return the interest of particular user. Now whenever we would like to know the interest of particular account holder will simple call this methods, we are not interested how the interest is calculated + what all operations or formulas its using and all we are simple interested in the result that is to [show only the necessary details without including the background details.
By Definition "Abstraction is the way to do work without knowing how is this happening"
it is the headache of method to perform corresponding task.
Just see this picture if want to fire the bullet then we simple pressed trigger now its the headache of trigger to fire the bullet.
I hope you understand the idea of Abstraction... :)
No comments:
Post a Comment