Abstraction
Lets consider the example of String class. If the type is of the String then it will definitely support the operations like Concat, IndexOf, Substring, etc. In this case, the operations supported by the entity depend on its type. This is known as abstractions.
Let's look below figure you will get better idea on what Abstraction means,
- Abstraction refers to the act of representing essential features without including the background details or explanations.
- Abstraction defines way to hide your data and members from outside world.
- This is achieved by means of access specifies.
- e.g.: Interface
- Abstraction is used to create a common set of methods that might have different specific implementations by subclasses.
Lets consider the example of String class. If the type is of the String then it will definitely support the operations like Concat, IndexOf, Substring, etc. In this case, the operations supported by the entity depend on its type. This is known as abstractions.
Let's look below figure you will get better idea on what Abstraction means,
In Fig A: Type Name is of string type, so it will support only string related function's only like concat, contains, clone, substring, lenght etc.
In Fig B: Type Roll Num is of Int type, so it will support only int related function's only.
So operations supported by the entity depend on its type. Means showing only essential features is called as Abstraction.
Advantages:
- Hinding Implmentation Detail
- Extensiblity
- Component Reuse
cool. thanks for clearing that up for me!
ReplyDelete@The Computer Tutor: Most welcome. You can follow us on google+ & subscribe us by just providing your email id.
Delete