Guest User

executorservicejfxpt2

a guest
Oct 24th, 2023
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.40 KB | Software | 0 0
  1.  
  2.  import java.util.concurrent.ExecutorService;
  3.  
  4. import java.util.concurrent.Executors;
  5.  
  6. import javafx.concurrent.Task;
  7.  
  8. Task <Void> task=new Task<Void>() {
  9.  @Override
  10.    protected Void call() throws Exception {
  11.      System.out.println("Metodo.call()");
  12.          return null;// retorno nul
  13.  
  14. }    
  15.  };
  16.     ExecutorService exS=Executors.newSingleThreadExecutor();
  17.       exS.submit(task);
  18.  
  19.  
Advertisement
Add Comment
Please, Sign In to add comment