要使处于不同层次,甚至是互不相关的类可以具有相同的行为采用______。
关于文件名的处理中,测试当前文件是否目录用______函数。
boolean IsDirectory()
下列程序的功能是创建了一个显示5个"Hello!"的线程并启动运行,请将程序补充完整。
public class ThreadTest extends Thread
public static void main(String args[])
ThreadTest t=new
t.start( );
public void run( )
int i=0;
while(true)
System.out.println("Hello!");
if(i++==4) break;
ThreadTest()
包含Swing构件的Applet(小应用程序)应该是______类的子类。
JApplet或javax.swing.JApplet
请阅读下列程序代码,然后将程序的执行结果补充完整。
程序代码:
public class throwsException
static void Proc(int sel)
throws ArithmeticException,ArrayIndexOutOfBoundsException
System.out. println("In Situation"+sel);
if(sel==0)
System.out.println("no Exception caught");
return;
else if(sel==1)
int iArray[]=new int[4];
iArray[1]=3;
public static void main(String args[])
try
Proc(0);
Proc(1);
catch(ArrayIndexOutOfBoundsException e)
System.out.println("Catch"+e);
finally
System.out.println("in Proc finally");
执行结果:
In Situation 0
no Exception caught
______
in Proc finally
In Situationl
请将程序补充完整。
import java.awt.*;
public class FirstFrame extends Frame
public static void main(String args[])
FirstFrame fr=new FirstFrame("First container!");
fr.setSize(240,240);
fr.setBackground(Color.yellow);
______
public FirstFrame(String str)
super(str);
fr.setVisible(true);
J2SE作为一种应用和开发环境,提供了一整套实用工具,其中( )是Java语言的编译工具。
A:java B:javadoc C:javap D:javac
在数据管理技术发展过程中,文件系统与数据库系统的主要区别是数据库系统具有( )。
A:数据无冗余 B:数据可共享 C:专门的数据管理软件 D:特定的数据模型
以下选项中正确的科学计数格式表示形式是( )。
A:E3 B:3.2E0.5 C:3.2E2 D:3.2E
下列叙述中,错误的是( )。
A:Java中,方法的重载是指多个方法可以共享同一个名字 B:Java中,用abstract修饰的类称为抽象类,它不能实例化 C:Java中,接口是不包含成员变量和方法实现的抽象类 D:Java中,构造方法可以有返回值