Skip to content

Instantly share code, notes, and snippets.

@Maes95
Created March 27, 2017 14:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Maes95/e4e7fafa0dba329ccee0f12eb7025399 to your computer and use it in GitHub Desktop.
Save Maes95/e4e7fafa0dba329ccee0f12eb7025399 to your computer and use it in GitHub Desktop.
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