相关题目
下列哪个选项是Java调试器,如果编译器返回程序代码的错误,可以用它对程序进行调试?
下列哪个选项是合法的标识符?
Class类的对象由______自动生成,隐藏在.class文件中,它在运行时为用户提供信息。
在下列程序的空白处,应填入的正确选项是:
import java.io.*;
pulilc class ObjectStreamTest{
publilc static void main(string args[]) throws IOException{
ObjectOutputStream oos= new ObjectOutputStream
(new FileOutputStream("serial.bin"));
java.util.Date d= new Java.util.Date();
oos. ______ (d);
ObjectInputStream ois=
new ObjectInputStream(new FileOutputStream("serial.bin"));
try{
java.util.date restoredDate = (java.util.Date) ois.readObject();
System.out.println ("read object back from serial.bin file:" + restoredDate);
}
catch (ClassNotFoundException cnf) {
System.out.println ("class not found");
}
}
Java中类ObjectOutputStream支持对象的写操作,这是一种字节流,它的直接父类是:
在多线程并发程序设计中,能够给对象x加锁的语句是:
构造方法名必须与______相同,它没有返回值,用户不能直接调用它,只能通过new调用。
下列程序的功能是统计字符串中"array"的个数,在程序的空白处应填入的正确选项是:
public class FindKeyWords{
public static void main(sring[] args){
String text=
" An array is a data structur that stores a collection of"
+ "values of the same type . You access each individual value"
+ "through an integer index . For example,if a is an array"
+ "of inergers, then a[i] is the ith integer in the array.";
int arrayCount =0;
int idex = -1;
String arrarStr ="array";
index = text.indexof(arrayStr);
while(index ______ 0) {
++arrayCount;
index += arrayStr.length();
index = text.indexof(arrayStr,index);
}
System.out.println
("the text contains" + arrayCount + "arrays");
}
}
String、StingBuffer都是______类,都不能被继承。
Java中的基本数据类型int在不同的操作系统平台的字长是:
