×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    17

    passing method as parameter to another method

    I want to write a version of the Timer class so that I have more control over the events like being able to pause the timer.
    The library version of Timer.Schedule has the definition:
    Schedule( java.util.TimerTask task, long delay);
    How would I code the definition of my version of this method, so that it recognises the method I pass it as a TimerTask ?
    In C it would be a function pointer.

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    12

    RE: passing method as parameter to another method

    You probably can't. In standard java (not J2ME) you could use reflection but since, as far as I know, J2ME doesn't support reflection there's probably no way of doing this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×