Re: what is abstraction ?
"gk" <srcjnu@gmail.com> writes:
what is abstraction ?
It means to leave out something.
For example, in Java, abstracting "3" from the expression
2 * 3
gives the method
public static int twice( final int x ){ return x * 3; }
So now, the "2" has been abstracted out of the ... abstraction.
And the abstraction has been "named" (often "abstraction" is
a shorthand for the term "named abstraction").
By naming an abstraction one is lead to the creation of a new concept.
For example, abstracting even the ?3?
public static int product( final int x, final int x1 ){ return x * x1; }
yields the concept of multiplication.
Applying an abstraction to arguments yields or expresses something
as in ?product( 2, 3 )?.
The abstraction is a means do dissect a text into chunks
so that they can be reused. We abstract the parts that restrict
reuse of something within another context and thus we obtain
a reusable entity, namely the abstraction.
An unnamed abstraction would be the lambda-expression
\x.x?3
where "lambda" was written as "\", but just forget this example,
if you do not know lambda-calculus or read more about it at
Google or Wikipedia.
and also does abstraction has any relation with abstract class ?
The bodies of the methods have been abstracted from such a class.