|
Java™ by example!
|
|
|
How do I make the speaker beep?
The first example simply beeps the speaker through an ASCII code:
The second example makes use of the AWT Toolkit's method beep. Note that even though we only use the AWT to make a beep, it automatically creates a non-daemon thread that keeps the program alive when it reaches the end of the main method. This is why there is a call to System.exit.
Further Information
Author of answer: Joris Van den Bogaert
Comments
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|