d28e6b3b5402f0b1b8b8cc9dcc24813ad6e13de7
3 public static void main(String
[] args
) {
4 final int THREADS_NUMBER
= 3;
5 ExThread threadArray
[] = new ExThread
[THREADS_NUMBER
];
6 Thread t
[] = new Thread
[THREADS_NUMBER
];
8 for (int i
= 0; i
< threadArray
.length
; i
++) {
9 threadArray
[i
] = new ExThread(String
.valueOf(i
));
10 t
[i
] = new Thread(threadArray
[i
]);
14 for (int i
= 0; i
< threadArray
.length
; i
++) {
18 catch (InterruptedException e
) {
19 // this part is executed when an exception (in this example InterruptedException) occurs
22 System
.out
.println("Threads execution finished");