Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Interfaces

 
Smitha Prasad
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is call back function?
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Smitha,
I did a quick search on the Java in General (beginner) forum for "call back" in the subject (any date). Three promising looking explanations resulted:
callback methods - 2001.05.16
java callback - 2001.09.27
CallBack functions... - 2002.03.25
Note: The search page link is at the top right of this page and a lot of useful information can be found with it.
Good Luck.
 
Smitha Prasad
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks!
 
Kaustubh Patil
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whenever you delegate a certain responsibility to the language or the s/w before commiting anything ,sometimes, it calls a function ( user defiened ). it is here that the user gets the chance to do some clean up activities..
These are called as call-back functions..
I can give u some examples..
One can think of finalize() as a call-back function..
Before the JVM takes the object for garbage collection it calls the finalize method of that object, in which the user can write some clean up activities...in a way the control is passed from the JVM "back" to the user obj.
another example i can think of is from the entity beans of EJB framework. In container managed persistant entity beans all the database commit's and rollback are handles by the EJB container. But before any commit or rollback is fired methods are called in the users EJB where the user has the chance to do any activites before the database commits or rollbacks.
Hope this is of some help.
Kaustubh.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic