填空题下列程序的执行结果是【 】。
import java.io. * ;
public class ArrayTest {
public static void main(String args[ ]) {
int i;
int a [ ]=new int[5];
for(i=0; i=0;i- -)
System.out.print("a["+i+"]="+a[i]);
}
}
填空题Swing 中用来表示进程条的类是 javax.swing.________
填空题数据流图有两种典型的结构形式,它们分别是变换型和______。
填空题以下程序运行后的输出结果是______。 main() int m=011,n=11; printf("%d %d/n",m++,m^n++);
填空题请写出下面程序的运行结果:
public class Test extends TT{
public static void main(String args[])(
Test t=new Test("Tom.");
}
public Test(SUing 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}}。
填空题本题中定义了一个树型的通信录,窗口左侧是一个树,右侧是一个文本域,单击树的结点,则在右侧文本域中显示相关信息,如果单击的是树结点,则显示对应名字的电话信息。 import javax. swing. * ; import javax. swing. tree. * ; import java. awt. * ; import java. awt. event. * ; import javax. swing. event. * ; class Mytree2 extends JFrame______ JTree tree=null; JTextArea text=new JTextArea(20,20); Mytree2() Container con=getContentPane(); DefauhMutableTreeNode root=new DefauhMutableTreeNode ("同学通信录"); DefaultMutableTreeNode t1=new DefauhMutableTreeNode("大学同学"); DefaultMutableTreeNode t2=new DefaultMutableTreeNode("研究生同学"); DefaultMutableTreeNode t1_1=new DefauhMutableTreeNode("陈艳"); DefauhMutableTreeNode t1_2=new DefaultMutableTreeNode("李小永"); DefauhMutableTreeNode t2_1=new DefaultMutableTreeNode("王小小"); DefaultMutableTreeNode t2_2=new DefaultMutableTreeNode("董小"); setTitle("java2"); root. add(t1); root. add(t2); t1. add(t1_1); t1, add(t1_2); t2. add(t2_1); t2. add(t2_2); tree=new JTree(root); JScrollPane scrollpane=new JScrollPane(text); JSplitPane splitpane=new JSplitPane(JSplitPane. HORIZONTAL_SPLIT, true, tree, scrollpane); tree. addTreeSelectionListener(this); con. add(splitpane); addWindowListener( new WindowAdapter() public void windowClosing(WindowEvent e) System. exit(0);); setVisible(true); setBounds(70,80,200,300); public void valueChanged(TreeSelectionEvent e) if(e, getSource()==tree) DefaultMutableTreeNode node= (DefaultMutableTreeNode) tree. getLastSelectedPathComponent(); if(node. isLeaf()) String str=______; if(str. equals("陈艳")) text. setText(str+":联系电话: 0411-4209876"); else if(str. equals("李小永")) text. setText (str+":联系电话: 010 -62789876"); else if(str. equals("王小小")) text. setText (str+": 联系电话: 0430-63596677"); else if(str. equals("董小")) text. setText(str +": 联系电话: 020-85192789"); else text. setText(node. getUserObject(). toString()); public class java2 public static void main(String args[]) Mytree2 win=new Mytree2(); win. pack();
填空题标识符是以 ______ 、下划线(__)、美元符($)作为首字母的字符串序列。
填空题多线程是Java语言中的 【6】 机制,它能够处理同步共享数据和各种不同的事件。
填空题在一个容量为25的循环队列中,若头指针from=16,尾指针rear=9,则该循环队列中共有 【1】 ,个元素。
填空题可以通过{{U}} 【10】 {{/U}}语句来捕获所有的异常。
填空题多线程是Java语言中的{{U}} 【6】 {{/U}}机制,它能够处理同步共享数据和各种不同的事件。
填空题{{U}}【9】 {{/U}}方法用于更新图形。它首先清除背景,然后设置前景,再调用paint()方法完成组件中的具体绘图。
填空题设有数组定义: int MyIntArray[] = {10, 20, 30, 40, 50, 60, 70};, 则执行下列几个语句后的输出结果是______。
int s = 0;
for(int i = 0; i < MyIntArray,length; i++)
s += MyIntArray[i];
System.out.println(s);
填空题以下程序计算1+1/3+1/5+…+1/(2N+1),直至1/(2N+1)小于0.00001,请在横线处将程序补充完整。 public class Sun public static void main(String args[]) int n=1; double term, sum=1.0; do n= 【12】 ; term=1.0/n; sum=sum+term; while(term>=0.00001); System.out.pfintln(n); System.out.println(sum);
填空题编程语言大致分为面向机器,面向过程和面向对象3种结构,Java语言是面向{{U}} 【6】 {{/U}}的一种网络编程语言。
填空题lava通过过滤流对I/O访问提供 【10】 机制。
填空题在常值变量中,整型的最大值是【 】。
填空题Java程序中定义接口所使用的关键字是{{U}} 【9】 {{/U}}。
填空题排序是计算机程序设计中的一种重要操作,常见的排序方法有插入排序、______和选择排序。
填空题若a,b为int型变量且已分别赋值为2,6,则表达式(a++)+(++b)+a * b的值是 ______。
