问答题库

当前位置: 计算机等级考试题库 > JAVA题库

问题描述:

[单项选择题] WindowListener 中可以实现窗口关闭功能的方法是______。


A.public void windowOpened(WindowEvent
B.public void windowClosed(WindowEvent
C.public void windowClosing(WindowEvent
D.public void windowDeactivated(WindowEvent

final属性是专门定义_________变量的保留字。 Java程序包括源代码(.java文件)、__________、由归档工具生成jar生成的.jar文件、对象状态序列化.ser文件。 下面程序的执行结果是______。 public class ex27 { public static void main(String[] args) { try { return; } finally { System. out. print in ( "Finally" ); } } 下列的Java语句是把字符串“12345”转换为int型数据,请补充完整。   int x;   x= 【 】 ; 下列程序实现了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){} } 请选择正确的语句填入横线处。

点评难度:

      

您觉得难度如何呢?请反馈给我们,谢谢!

参考答案:

C

试题分享:

相关考题