[單項(xiàng)選擇題] 下列程序?qū)崿F(xiàn)了2個(gè)監(jiān)聽器接口:ActionListener和W1ndowListener。import java.awt.*; import
[單項(xiàng)選擇題] 下列程序?qū)崿F(xiàn)了2個(gè)監(jiān)聽器接口: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
正確答案:B
詞條內(nèi)容僅供參考,如果您需要解決具體問題
(尤其在法律、醫(yī)學(xué)等領(lǐng)域),建議您咨詢相關(guān)領(lǐng)域?qū)I(yè)人士。