-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplication.java
More file actions
34 lines (24 loc) · 833 Bytes
/
Copy pathApplication.java
File metadata and controls
34 lines (24 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class Application
{
private static int threadNum = 3;
public static void main(String[] args)
{
ExecutorService executorService = Executors.newFixedThreadPool(threadNum);
for(int i = 0; i < 3; i++) {
executorService.execute(new SoundPlay());
System.out.println("---> Playing Sound: " + i);
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
executorService.shutdown();
System.out.println(executorService.isShutdown());
PlaySound.setSoundPath("resources/bleep.wav");
PlaySound sound = PlaySound.getInstance();
sound.play();
}
}