posted 14 years ago
The abstraction can be used/applied in various situations/purposes:
data abstraction, operational abstraction, functional abstraction, procedural abstraction, behavioral abstraction etc.,
I can say
1. ADT's (Abstract Data Types) or structures (struct) in C/C++, classes in C++/Java are Examples for data abstraction
2. operators are examples for operational abstraction
3. functions are examples for functional abstraction
4. procedures in Pascal/FORTRAN/BASIC/COBOL are examples for procedural abstraction
5. classes in C++/Java are examples for behavioral abstraction(Here, we can say, both data abstraction and functional abstraction are combined, and of course, called encapsulation.)
similarly other types of abstractions.
Example for operational abstraction:here the operator *provides abstraction for multiplication operation, means the programmer/user can understand that the operator * will perform multiplication operation on 5 and 6 and then returns the product 30 to prod.
But it will not say how this multiplication takes place. The underlying Language processor (compiler/interpreter) will take care how to multiply numbers.
Depending on the complexity of the situation (problem/program/application/etc.,) the abstraction is achieved at several levels.