单选题下列APl不属于Java.lang.Math类的一个是______。
单选题下面程序段的输出结果是( )。 class Base int i; Base() add(1); void add(int v) i+=v: void print() System.out.println(i); class Extension extends Base Extension() add(2); void add(int v) i+=v*2: public class Test public static void main(String args[]) bogo(new Extension()); static void bogo(Base b) b.add(8); b.print(); A.9 B.18 C.20 D.22
单选题下列关于顺序存储结构的叙述中,错误的是( )。
单选题下列选项______不是PilterInputStream的子类。
单选题设x=1,y=2和z=3,则表达式y+=z—/++x的值是( )。
单选题以下叙述中正确的是( )。 A.C语言中的全部数据类型都是基本类型 B.C语言中的全部数据类型都是构造类型 C.C语言中的数据类型只有两种,即基本类型和构造类型 D.以上都不对
单选题若文件是Random AccessFile的实例file,并且其基本文件长度大于0,则下面的语句实现的功能是 ( )file.seek(file.length()-1);
单选题下面关于串行化的说法中正确的是( )。 Ⅰ:对象串行化机制需要将对象的状态保存到文件中,而后能够通过读入对象状态来重新构造对象,恢复程序状态。 Ⅱ:通过让类实现java.io.Serializable接口可以将类串行化。这个接口是一个制造者(marker)接口。也就是说,对于要实现它的类来说,该接口不需要实现任何方法。 Ⅲ:将对象读出或者写入流的主要类有两个:ObjectOutputStream与ObjectInputStream。 Ⅳ:以上都不对。
单选题下列Applet实现了用不同颜色打印出大写字母A~J。请选择正确的语句填入横线处。 import java.applet.*; import java.awt.*; public class ex29 extends Applet { public void paint (Graphics gg) { int r = 0, g = 0, b = 0, j = 20; for(char ch = 'A'; ch <= 'J'; ch ++) { gg.drawString("" + ch, j, 30); if(ch - 'A' % 3 == 0) r += 50; if(ch - 'B' % 3 == 0) g += 30; if(ch - 'C' % 3 == 0) b += 20; j +=17; } } }
单选题设有整型数组的定义:inta[ ];new int[8];,则a.length的值为下列哪项?
单选题设有n元关系R及m元关系S,则关系R与S经笛卡儿积后所得新关系是—个( )元关系。
单选题下列程序通过设定线程优先级,抢占主线程的CPU,选择正确的语句填入横线处。 class T14 implements Runnable private Boolean fStop - true; public void run() while(fStop) System.out.println(Thread.currentThread().getName() + "run"); try Thread.sleep(l); catch(Exception e) e.printStackTrace(); public void stopRun() fStop = false; public class Testl4 public static void main(String[] args) T14 t14 = new T14(); Thread t1 = new Thread(ti4, "T14"); Thread t = Thread.currentThread()'; ______; Ti.start(); T14.stopRun(); System.out.println ( "stop ");
单选题在下列链表中,能够从任意一个结点出发直接访问到所有结点的是______。
A.单链表
B.循环链表
C.双向链表
D.二叉链表
单选题下列程序的运行结果是______。
public static ArrayTest{
public static void main(String[] args){
int data[] [] = {{1,2,3,4,5},{11,22,33,44,55},{111,222,333, 444,555}};
for(int i=0;i<data.length;i++){
if(i%2==0) {
System.out.println(data[i] [4]+" ");
}
}
}
}
单选题阅读下面程序 import javax.swing.JOptionPane; public class BreakLabelTest public static void main(String args[]) String output=" ": stop: for(int row=1;row<=10;row++) for(int column=1;column<=5;colunm++) if(row==5)break stop; output+="*": output+="/n"; output+="/nLoops terminated normally": JOptionPane.showMessageDialog(null,output,"用一个标志测试break语句", JOptionPane.INFORMATION_MESSAGE); System.exit(0); 程序运行的结果是
单选题阅读下列代码 public class Test public static void main (String args[]) System.out.printIn(89>1); 其运行结果是______。
单选题下列对继承的说法正确的一项是
单选题下面的程序是完成一个容器的例子,所缺部分正确的选项是( )。 import java.awt.*; public class MyFrame extends Frame public static void main(String args[]) MyFrame fr=new MyFrame("Hello Out There!"); fr.setSize(200,200); fr.setBackground(Color.red); ______; public MyFrame(String str) super(str);//调用父类的构造方法 A) fr.setVisible(false) B) fr.setVisible C) fr.setVisible(true) D) 以上都不是
单选题下列程序实现对ZIP文件file.zip的检索,在横线处填入正确的语句______。 package
test; import java.io.*; import
java.util.*; import java.util.zip.*; public
class Exam { public static void main(String
[]args)( try{ FilelnputStream fis=new
FilelnputStream("test/file.zip"); ZiplnputStream zis=new
ZiplnputStream(fis); ZipEntry en;
while((______)!=null){ en.getName();
zis.closeEntry(); } zis.close();
} catch(Exception e){
e.printStackTrace(); } } }
A.en=zis.getNextEntry()
B.en==zis.getNextEntry()
C.en=zis.getEntry()
D.zis.getNextEntry()
单选题下列______不属于计算机常用的外部设备。