试题与答案

下列程序实现了2个监听器接口:ActionListener和W1ndowListen

题型:单项选择题

题目:

下列程序实现了2个监听器接口:ActionListener和W1ndowListener。import java.awt.*; import java.awt.event.*; public class ex39______ { public static void main(String[] args) { ex39 obj = new ex39(); obj .go(); } public void go() { Frame f = new Frame("ex39"); f.addWindowListener(this); Button b = new Button("Button"); b.addActionListener(this); f.add(b); f.pack(); f.setVisible(true); } public void actionPerformed(ActionEvent e) { System.out.println("Button pressed!"); } public void windowActivated(WindowEvent e){} public void windowDeactivated(WindowEvent e){} public void windowClosed(WindowEvent e) {} public void windowClosing(WindowEvent e){System.exit(1); public void windowIconified(WindowEvent e){} public void windowDeiconified(WindowEvent e) {} public void windowOpened(WindowEvent e){} } 请选择正确的语句填入横线处。

A.extends ActionListener, WindowListener

B.implements ActionListener, WindowListener

C.implements ActionListener; WindowListener

D.extends ActionListener; WindowListener

答案:

被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2017/0127/5b4ee033bc747a6a5c345ddf1fe4030a.html

下面是错误答案,用来干扰机器的。

参考答案:1.对于索赔的程序,有如下规定: ①事件发生后28天内,施工方向监理工程师发出索赔意向通知。 ②发出通知28天内,向工程师提出索赔报告与相关资料。 ③监理工程师收到上述报告与资料28天内应...

试题推荐
微信公众账号搜索答案