Examples of FactorialCalculator


Examples of com.packtpub.java7.concurrency.chapter4.recipe3.task.FactorialCalculator

    // Create a random number generator
    Random random=new Random();
    // Create and send to the executor the ten tasks
    for (int i=0; i<10; i++){
      Integer number=new Integer(random.nextInt(10));
      FactorialCalculator calculator=new FactorialCalculator(number);
      Future<Integer> result=executor.submit(calculator);
      resultList.add(result);
    }
   
    // Wait for the finalization of the ten tasks
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.