Advertisement
sergAccount

Untitled

Mar 21st, 2021
819
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 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.app25;
  7.  
  8. import java.util.concurrent.ExecutorService;
  9. import java.util.concurrent.Executors;
  10.  
  11. /**
  12.  *
  13.  * @author Admin
  14.  */
  15. public class Main2 {
  16.    
  17.     public static void main(String[] args) {
  18.        
  19.         ExecutorService eService = Executors.newFixedThreadPool(2);
  20.         // создаем задачу типа Runnable (MyTask)
  21.         //
  22.         Runnable r = new MyTask();  
  23.         eService.execute(r);
  24.     }
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement