Toolkit.beep() has the following syntax.
public abstract void beep()
In the following code shows how to use Toolkit.beep() method.
//from w w w. j ava2 s.com import java.awt.Toolkit; public class Main { public static void main(String[] args) { Toolkit tk = Toolkit.getDefaultToolkit(); tk.beep(); } }