Advertisement
sergAccount

Untitled

Jan 30th, 2021
688
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package com.mycompany.app5;
  7.  
  8. import java.util.concurrent.Callable;
  9. import java.util.concurrent.TimeUnit;
  10.  
  11. /**
  12.  *
  13.  * @author Admin
  14.  */
  15. public class MyCallableTask implements Callable<String>{
  16.    
  17.     public MyCallableTask(){        
  18.     }
  19.  
  20.     @Override
  21.     public String call() throws Exception {
  22.         System.out.println("MyCallableTask>>");
  23.         TimeUnit.SECONDS.sleep(4);
  24.         System.out.println("MyCallableTask<<");
  25.         return "RESULT";
  26.     }    
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement