init()方法是用来完成初始化操作的,在Applet程序运行期间只执行一次。 正确
start()方法被系统自动调用来启动主线程运行。通常在Applet程序被重新启动时,该方法被系统自动调用。 正确 paint()方法是在需要重画图形界面时被系统自动调用来显示输出结果的。 正确 stop()方法是用来暂停执行操作的,它与start()方法不同,只被调用 一次。 错误 init(),start(),stop()和destroy()4个方法构成了Applet程序的生命周期。 正确 Graphics类提供了3种绘制文本的方法,其方法名都是drawString()。 正确 绘制椭圆的方法是drawOval(),使用该方法可以绘制圆。 正确 异常是一种特殊的运行错误的对象。 正确 异常处理可以使整个系统更加安全稳定。 正确 异常处理是编译时进行的。 错误
异常通常是指Error类和Exception类。 错误
Exception类只有一个子类为RuntimeException。 错误 在异常处理中,出现异常和抛出异常是一回事。 错误 运行时异常是在运行时系统检测并处理的。 错误 线程的启动是通过引用其start()方法而实现的。 正确
当线程类所定义的run()方法执行完毕,线程的运行就会终止。 正确 关键词synchronized只能对方法进行修饰。 错误 线程组的作用是将多个线程作用一个整体来进行控制。 正确 死锁的产生原因是因为多个线程间存在资源竞争。 正确 若所有用户线程都终止了,java程序就会结束。 正确 文件缓冲流的作用是提高文件的读/写效率。 正确
当DataInputStream对象读到文件结束处,则返回-1。 错误 通过File类不能对文件属性进行修改。 正确
RandomAccessFile对象是通过移动文件指针的方式来进行随机访问的。 正确
程序阅读题 阅读以下程序,若输入: 1<回车> 2<回车> 3<回车> 4<回车> 5<回车> 以下程序的运行结果是 import java.io.* ; public class Test_3 { public static void main(String args[ ]) { int a[ ] = new int[5]; for (int i = 0 ; i < a.length ; i++ ) try { BufferedReader br = new BufferedReader( new InputStreamReader(System.in)); a[i] = Integer.parseInt(br.readLine( )); } catch ( IOException e ) { } ; int s=0; for (int i = 0 ; i < a.length ; i++ ) { s+=a[i]; } System.out.print(s); {=15} } } 运行结果: import java.io.*; public class Test02{ public static void main(String args[]){ String s1 = \ String s2 = new String(\ System.out.println(s1.concat(s2)); } } 运行结果: class StaticTest{ public int x=1; public static int y=3; } public class Test03 { public static void main(String[] args) { StaticTest.y+=1; StaticTest t1=new StaticTest(); t1.x+=1; t1.y+=1; System.out.println(\ } } {=Java Program!} {=x=2,y=5} 运行结果: public class Test01{ public static void main(String[ ]args){ int x = -6,y = 6; x = x + y--; System.out.println(x); } } 运行结果: public class Test02 { public static void main(String[ ] args) { System.out.println( fun(30, 20, 10) ); } static int fun(int x, int y, int z) { return fun( x, fun(y,z) ); } static int fun(int x,int y) { if(x>y) return x; else return y; } {=0} {=30} } 运行结果: class B{ int n; static int sum=0; void setN(int n){ this.n=n;} int getSum(){ for(int i=1;i