permaculture playing cards
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes callback Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "callback" Watch "callback" New topic


Renata fonseca
Ranch Hand

Joined: Mar 15, 2002
Posts: 48
i'd like to know the meaning of "callback", in Java. How do I can implement it? Using class, interface?
Snigdha Solanki
Ranch Hand

Joined: Sep 07, 2000
Posts: 128
There is a good article in JavaWorld on implementing callback.
Check this out - Implementing Callback

Snigdha<br />Sun Certified Programmer for the Java™ 2 Platform
Renata fonseca
Ranch Hand

Joined: Mar 15, 2002
Posts: 48
Sorry but I don't think that article in JavaWorld is good...
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
A good example of an application that uses callbacks is a SAX parser that parses an XML document. A SAX parser such as
Xerces will define an interface such as ContentHandler the declares methods that are called by the parser each time an event occurs such as the start and end of a document or element. Your application code will implement the interface and then pass your implementation to Xerces. In reponse, Xerces will call your methods each time Xerces detects an event such as start or end of a document or element or any other event.

Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="" target="_blank" rel="nofollow">Try my mock exam.</a>
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
Here there is an example of callbacks File class
And here is another sorting
Also here

SCJP2. Please Indent your code using UBB Code
I agree. Here's the link:
subject: callback
jQuery in Action, 3rd edition