Problem1190--Java 接口(Interface)演示

1190: Java 接口(Interface)演示

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 1  Solved: 1
[Submit] [Status] [Web Board] [Creator:]

Description

代码如下

import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import javax.swing.Timer;
 
public class Java_2 {
    public static void main(String[] args) {
        //*********Found********** 
        ActionListener listener = new __________________();
        Timer t = new Timer(10000, listener);
        t.start();
        JOptionPane.showMessageDialog(null, "退出程序吗?");
        System.exit(0);
    }
}
//*********Found********** 
class TimePrinter ___________________ ActionListener{ 
    //*********Found********** 
    public void actionPerformed(___________________ event) {
        Date now = new Date();
        System.out.println("At the tone, the time is " + now);
        //*********Found********** 
        ___________________.getDefaultToolkit().beep();
    }
}

Source/Category