这个我试过了,没反应,好像说是要在控制面板中设置什么,不过没看明白 (Windows) The sound used is determined from the setting found in Control Panel/Sounds and Devices/Sounds/Sound Scheme/"Default Beep". If no sound file is selected then the beep() will be a silence.
循环调用并不额外消耗内存啊for (int i = 0;i<100;i++) { Toolkit.getDefaultToolkit().beep(); Thread.sleep(500); }
(Windows) The sound used is determined from the setting found in Control Panel/Sounds and Devices/Sounds/Sound Scheme/"Default Beep". If no sound file is selected then the beep() will be a silence.
Toolkit.getDefaultToolkit().beep();
Thread.sleep(500);
}