How to Pass Arguments to Timertask Run Method

后端 未结 5 768
悲&欢浪女
悲&欢浪女 2021-01-12 21:45

I have a method and I want it to be scheduled for execution in later times. The scheduling time and method\'s arguments depend on user inputs.

I already have tried T

5条回答
  •  日久生厌
    2021-01-12 21:57

    You will need to extend the TimerTask and create a constructor and/or setter fields.. Then set the values you want before scheduling the TimerTask for execution.

提交回复
热议问题