aspose file tools*
The moose likes Beginning Java and the fly likes how does this code make beep sound Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how does this code make beep sound" Watch "how does this code make beep sound" New topic
Author

how does this code make beep sound

Naufal Mohamed
Greenhorn

Joined: Jan 14, 2003
Posts: 5
hi everybody
i'm new to this forum and a novice for java.
i'm delighted about this forum where beginners like me can clarify even a simple problem in java.
hope that i too get the fullest support from you guys.thank you
heres my problem:
for (i=0; i<10; i++)
System.out.print((char)7);
above for loop makes the computer to beep.
how does this happen? is this a standard method to
make the computer beep?
[ January 14, 2003: Message edited by: Naufal Mohamed ]
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9053
    
  12
(char)7 is equal to Ascii 0007 which is a control character. Letters/numbers don't begin until Ascii 28 or so. Control characters do special things. Form feed, carriage return, line feed, bell (which is the one you've discovered), and more. Most people don't use computer beeps anymore. Since speakers have come into more common usage, they use .wav files instead to get your attention.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Welcome to JavaRanch, Naufal!


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how does this code make beep sound