Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class StudentDTO extends TimerTask{
- @Override
- public void run(){
- System.out.println("hi");
- }
- public static void main(String[] args){
- StudentDTO t1=new StudentDTO();
- Timer timer = new Timer(true);
- timer.scheduleAtFixedRate(t1, 0, 10000);
- System.out.println("start");
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
Add Comment
Please, Sign In to add comment