these callback methods; what exactly are you referring to?
In C it is sometimes needed to pass a function pointer to, say, a library, so later the library can "call" that function "back".
In Java we use interfaces for that purpose. We pass an object and later a method of that object can be called back.
Also a method of a listener, like ActionListener's actionPerformed is a callback method.
> these callback methods; what exactly are you
> referring to?
>
> In C it is sometimes needed to pass a function
> pointer to, say, a library, so later the library can
> "call" that function "back".
>
> In Java we use interfaces for that purpose. We pass
> an object and later a method of that object can be
> called back.
> Also a method of a listener, like ActionListener's
> actionPerformed is a callback method.
Doesn't have to be an interface
> hi... thanks for reply..
> but...
> can I have some more explanation that Y are they
> called "Callback methods" ... need of their
> particular use... ?
This is not exclusive to java but is a general concept used throughout computer science. For a good general review of the concept, have a look here:
http://en.wikipedia.org/wiki/Callback_%28computer_science%29