Guest User

Untitled

a guest
Nov 14th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. public class StudentDTO extends TimerTask{
  2. @Override
  3. public void run(){
  4. System.out.println("hi");
  5. }
  6. public static void main(String[] args){
  7.  
  8. StudentDTO t1=new StudentDTO();
  9. Timer timer = new Timer(true);
  10. timer.scheduleAtFixedRate(t1, 0, 10000);
  11. System.out.println("start");
  12.  
  13. try {
  14. Thread.sleep(1000);
  15. } catch (InterruptedException e) {
  16. e.printStackTrace();
  17. }
  18.  
  19. }
Add Comment
Please, Sign In to add comment