Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

callback

 
Renata fonseca
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'd like to know the meaning of "callback", in Java. How do I can implement it? Using class, interface?
 
Snigdha Solanki
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a good article in JavaWorld on implementing callback.
Check this out - Implementing Callback
 
Renata fonseca
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry but I don't think that article in JavaWorld is good...
 
Dan Chisholm
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here there is an example of callbacks File class
And here is another sorting
Also here
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic