@jeigar2/

OnlySickHomalocephale

Java

No description

fork
loading
Files
  • Main.java
  • Tarea.java
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.Stream;
 
public class Main {
 
    public static void main(String[] args) {
 
        Stream<String> flujo = Stream.of("tarea1", "tarea2", "tarea3");
 
        ExecutorService servicio = Executors.newCachedThreadPool();
     
        flujo.map(t->new Tarea(t)).forEach(servicio::execute);
    }
 
}