A simple Callable and Future example..

.. with Java 1.7 style of Exception Handling!

RandomNumberGenerationTask.java
package biz.tugay.sandbox;
 
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.Callable;
 
public class RandomNumberGenerationTask implements Callable<Integer> {
 
    @Override
    public Integer call() {
        int finalNumber = 0;
        for (int i = 0; i < 10000000; i++) {
            finalNumber = ThreadLocalRandom.current().nextInt(-10000, 10001);
        }
        return finalNumber;
    }
}

App.java
package biz.tugay.sandbox;
 
import java.util.concurrent.Executors;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.ExecutionException;
 
public class App {
    public static void main(String[] args) {
        final RandomNumberGenerationTask task = new RandomNumberGenerationTask();
 
        final ExecutorService ex = Executors.newFixedThreadPool(16);
        final Future[] futureArray = new Future[250];
 
        long start = System.currentTimeMillis();
        for (int i = 0; i < 250; i++) {
            futureArray[i] =  ex.submit(task);
        }
 
        for (int i = 0; i < 250; i++) {
            try {
                System.out.println(futureArray[i].get());    
            } catch (InterruptedException | ExecutionException ignored) {
                // ignore..
            }
 
        }
 
        ex.shutdown();
    }
}

A sample output for goes like..
-6414
2569
6740
9327
-9258
6635
3015
-1511
-3239
6499
-9884
-6500
2977
-967
3552
1771
6674
-7682
5032
-6053
768
-8649
-3303
-6685
-172
7276
-8662
3121
5994
-790
-9976
-2573
-8935
-6208
-9721
781
2552
-5395
9231
6354
-4729
-1831
5154
2272
-3325
2004
1142
6903
-6108
1181
8093
3791
6733
1367
2380
-9336
-7556
7505
3420
3873
8949
7426
-7891
2507
-3551
-4271
-1169
26
2565
-6457
-8557
-2086
5940
-7208
-6765
-9455
4183
-1563
4436
5457
-4400
7446
-5863
2418
-3211
-6111
4123
-1050
-3698
8665
-3928
-2770
-6293
3729
-9471
2056
3986
-5245
2598
608
-4184
-6063
2438
-8967
-4550
4765
-943
1148
-1355
3046
-7336
-9004
-8517
1583
5913
-8929
6358
6991
5859
-5088
-265
-4968
-6073
5493
8225
1089
359
3769
-2932
1299
-5861
-5857
1884
-1474
-9310
-197
9313
-6260
3788
8655
-4041
8815
2839
-7640
-7969
-7247
-8155
-9885
-4385
-9097
9348
-4776
-9089
-7713
-2103
-4208
-862
2677
-5984
-5761
351
-511
3051
7838
6525
-5340
575
-6002
-698
-6017
-1849
4036
-4692
-7867
-6799
-7182
3951
-4259
1240
-5871
-348
3140
7184
-4003
2448
-742
5406
-9439
2250
-4882
-3116
-169
-6042
3981
-3372
-6050
1045
6347
2805
8717
5104
9803
8446
-1304
5932
8562
266
-2514
-900
3949
8665
6961
-588
-4279
3682
6452
-5419
-6945
-7865
5886
-5016
6855
968
-9584
-2206
-8453
-698
2336
-4342
-8465
-7881
6769
-8509
-6291
-6332
-5391
9275
9729
-3673
-1205
892
1184
-4674
-4244
-8076
9674
-8193
-8105
3008
-9123