填空题下列程序的功能是统计命令行参数的个数,请在下划线处填上适当的代码。
public class Length{
public static void main(String args[]){
System.out.println("number of String args:"+args. 【11】 );
}
}
填空题在两种基本测试方法中,______测试的原则之一是保证所测模块中每一个独立路径至少要执行一次。
填空题本题的功能是通过按钮来选择窗口显示的风格。窗口中有三个按钮:“Metal”、“Motif和“WindoWS“,单击任何一个按钮,就能将窗口的风格改变为按钮名称所对应的风格。 import java.awt*; import java.awt.event.*; import javax.swing.*; class PlafPanel extends JPanel implements Actionlis-tener public______() metalButton=new JButton("Metal"); motifButton=new JButton("Motif"); windowsButton=new JButton("Windows"); add(metalButton); add(motifButton); add(windowsButton); metalButlon.addActionListener(this); motifButton.addActionListener(this); windowsButton.addActionListener(this); public void actionPerformed(ActionEvent evt) Object source=evt.getSource(); string plaf=""; if(source==metaIButton) pIaF="javax.swing.plaf.metal.MetalLookAncl-Feel"; else if(source==motifButton) plaf="com.sun.java.swing.plaf.motif.Moti-fLookAndFeel"; else if(source==windowsButton) plaf="com.sun.java.swing.plaf.windows.windowsLookAndFeel"; try UIManager.setLookAndFeel(______); SwingUtilities.updateComponentTreeUI(ttlis); catch(Exception e) private JButton metalButton; private JButton motifButton; private JButton windowsButton; class PlafFrame extends JFrame public PlafFrame() setTitle("simple"); setSize(300,200); addWindowListener(new WindowAdapter() public void windowClosing(WindowEvent e) System.exit(0); ); Container contentPane=getContentPane(); contentPane.add(new PlafPanel()); public class java2 public static Void main(String[]args) JFrame frame=new PIafFrame(); frame.show();
填空题用于输入压缩文件格式的ZipInputStream类所属包是{{U}} 【8】 {{/U}}。
填空题对象串行化中,要被串行化的对象所属类的接口是【 】。
填空题若x = 5,y = 10,则x > y && x ++ = = y -- 的逻辑值为 【12】 。
填空题当需要提高读入字符串的效率,且要对字符串进行添加、删除、插入等操作时,最好使用{{U}} 【9】 {{/U}}类。
填空题如果一个Java Applet源程序文件只定义一个类,该类的名称为MyFirst Applet,则存储该源程序文件的文件名必须为MyPirstApplet.java,那么编译该程序文件将产生的字节码文件名为 【15】 。
填空题Java语言中,移位运算符包括:>>、<<和 【6】 。
填空题Applet类中用于返回包含Applet的HTML文件的URL方法是 【10】 。
填空题多线程是Java语言的{{U}} 【1】 {{/U}}机制,它能够处理同步共享数据和各种不同的事件。
填空题setLayout()方法是所有容器的父类 【9】 的方法。
填空题面向对象的程序设计方法中涉及的对象是系统中用来描述客观事物的一个 【2】 。
填空题下列程序的运行结果是________。 import java.io.*; public class ABC public static void main(String args[]) int i; int a[]=11,22,33,44,55,66,77,88,99); for(i=0;i<a.length/2;i++) System.out.print(a[i]+a[a.length-i-1]+" "); System.out.println();
填空题在面向对象的程序设计中,用来请求对象执行某一操作或回答某些信息的要求称为{{U}} 【5】 {{/U}}。
填空题在Java程序中,能在WWW浏览器上运行的是______。
填空题Java的线程调度策略是一种基于优先级{{U}} 【12】 {{/U}}。
填空题Java中的对象锁是一种独占的 【12】 锁。
填空题在面向对象方法中,类之间共享属性和操作的机制称为 【3】 。
填空题设a=8,则表达式a>>>2的值是 【7】 。
