填空题常见的需求分析方法有{{U}} 【3】 {{/U}}和面向对象的分析方法。
填空题同一段程序可能产生不止一种异常,可以放置多个{{U}} 【8】 {{/U}}子句,其中每一种异常类型都将被检查,第一个与之匹配的就会被执行。
填空题关于文件名的处理中,测试当前文件是否目录用 【14】 函数。
填空题{{U}}【14】 {{/U}}所实现的接口是datainput接口和dataoutput接口。
填空题传递给实现了java.awt.event.MouseMotionListener接口的类中mouse Dragged()方法的事件对象是,{{U}} 【9】 {{/U}}类。
填空题设有整型数组的定义:int a []=new int[8];,则A.length的值为______。
填空题setLayout( )方法是所有容器的父类 【15】 的方法。
填空题按作用域分类,变量有局部变量、______、方法参数和异常处理参数。
填空题请写出下面程序的运行结果:
public class Test extends TT{
public static void main(String args[]
Test t=new Test ("Tom.");
}
public Test(String s){
super (s);
System.out.print("How are you?");
}
public Test(){
this("I am Jack.");
}
}
class TT{
public TT(){
System.Out.print ("Hi!");
}
public TT(String s){
this ();
System.out.print("I am"+s);
}
}
结果:{{U}} 【15】 {{/U}}。
填空题请完善程序(程序文件名:Java_3.java)并进行调试。请在下画线处填入正确内容,然后删除下画线。请勿删除注释行和其他已有的语句内容。[题目要求]在点击“Exit”按钮和窗口右上角的关闭按钮时,可以关闭窗口。程序运行后的界面如下图所示。源程序:importjava.awt.*;importjava.awt.{{U}}(1){{/U}}.*;publicclassJava_3implementsActionListener,{{U}}(2){{/U}}{ Framef; Buttonbe,bw,bs,bn,bc; publicvoidcreate(){ f={{U}}(3){{/U}}; be=newButton("East"); bw=newButton({{U}}(4){{/U}}); bs=newButton("South"); bn=newButton("North"); bc=newButton("Exit"); f.add(be,{{U}}(5){{/U}}); f.add(bw,"West"); f.add(bs,"South"); f.add(bn,"North"); f.add(be,"Center"); bc.addActionListener(this);//为按钮注册监听器 f.addWindowListener(this);//为按钮注册监听器 f.setSize(200,200); f.setVisible({{U}}(6){{/U}}); } publicstaticvoidmain(Stringargs[]){ Java_3fa=newJava_3(); fa.create(); } publicvoidactionPerformed(ActionEvente){ System.exit(0);//实现窗口关闭功能 }; publicvoidwindowOpened(WindowEvente){} publicvoidwindowClosing(WindowEvente){ System.exit(0);//实现窗口关闭功能 }; publicvoidwindowClosed(WindowEvente){} publicvoidwindowIconified(WindowEvente){} publicvoidwindowDeiconified(WindowEvente){} publicvoidwindowActivated(WindowEvente){} publicvoidwindowDeactivated(WindowEvente){}}
填空题Java语言的各种数据类型之间提供两种转换:{{U}} {{U}} {{/U}} {{/U}}和强制转换。
填空题设有以下变量定义,并已赋确定的值,char w;int x; float y; double z;,则表达式:w*x+z-y所求得的数据类型为 【2】 。
填空题Java图形用户界面技术的发展经历了两个阶段,具体体现在开发包AXVT和 【11】 。
填空题本题的功能是监听键盘敲击事件,并将敲击的字符显示在标签上。开始,文字标签提示“Please press your keyboard!”,当按下键盘上的字符键,文字标签就变为“'*'is pressed!”(*为所按字母)。 import java. awt. * ; import java. awt. event. * ; import javax. swing. * ; public class java2 extends Frame______ public static void main(String args[]) java2 f=new java2("java2"); Panel pan=new Panel(); f. init(); public java2(String str) super(str); public void init() addWindowListener(new WindowAdapter() public void windowClosing(WindowEvent e) System. exit(0); ); setSize(200,200); setLayout(new FlowLayout()); lab=new Label("Please press your keyboard!"); add(lab); addKeyListener(this); setVisible(true); public void keyTyped(KeyEvent e) lab. setText("/'"+______+"/'is pressed !"); repaint(); public void keyPressed(KeyEvent e) public void keyReleased(KeyEvent e) private Label lab;
填空题利用继承能够实现 【4】 。这种实现缩短了程序的开发时间,促使开发人员复用已经测试和调试好的高质量软件。
填空题可以通过{{U}} 【14】 {{/U}}语句来捕获所有的异常。
填空题通常元素进栈的操作是{{U}} 【2】 {{/U}}。
填空题SUN公司提出了______机制宋实现Java平台与关系数据系统的连接。
填空题下面程序构造了一个Swing Applet,在下画线处填入正确的代码。 import javax.swing.*; import java.awt.*; public class SwingApplet extends ______ JLabel 1=new JLabel("This is a Swing Applet."); public void init() Container contentPane=getContentPane(); contentPane.add(1);
填空题任何从{{U}} 【5】 {{/U}}派生的类都可以用throw语句抛出,抛出异常用来表明程序遇到的错误无法正常执行而需要异常处理。