Created
March 27, 2017 14:25
-
-
Save Maes95/e4e7fafa0dba329ccee0f12eb7025399 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.LinkedList; | |
import java.util.List; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
/** | |
* | |
* @author michel | |
*/ | |
public class NewMain { | |
private final static int BIG_INTEGER = 10000000; | |
/** | |
* @param args the command line arguments | |
*/ | |
public static void main(String[] args) { | |
ExecutorService executor = Executors.newCachedThreadPool(); | |
for(int i=0; i<10; i++) { | |
executor.execute(()->{ | |
List<Integer> list = new LinkedList<>(); | |
for(int j = 0; j < BIG_INTEGER; j++){ | |
list.add(j); | |
} | |
System.out.println(list.contains(-1)); | |
}); | |
} | |
executor.shutdown(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment