Import javax.swing.*;
Import java.awt.*;
Public class SwingApplet extends ( 13 ) {
Jlabel l = new Jlabel ( “ This is a Swing Applet. ” );
Public void init(){
C.ontainer contentPane = getContentPane();
contentPane.add(1);
}
}
[试题]( 15 )在下列 Java Applet 程序的下划线处填入代码,使程序完整并能够正确运行。import java.applet.*;import java.awt.*;public class HelloWorld ( 15 ) {public void paint(Graphics g){g.drawString( " Hello World! " ,25,25);}}
[试题]请在下划线处填入代码,是程序正常运行并且输出 “ Hello! ”C.lass Test ( 15 ) {Public static void main (String[] arge){Test t = new Test();t.start();}Public void run(){System.out.println( “ Hello! ” );}
[单选题]下面程序中需要对 Employee 的对象进行存储,请在下划线处填入正确选项。class Employee implements ___________{…… }A.)ComparableB.)SerializableC.)CloneableD.)DataInput
[单选题]下面程序中需要对Employee的对象进行存储,请在下划线处填入正确选项。 class Employee implements______ { ……}A.ComparableB.SerializableC.CloneableD.Datalnput
[单选题]要得到某目录下的所有文件名,在下列代码的下划线处应填入的内容是(两个下划线的填写内容相同)______pathName=new______(args[0]);String[]fileNames=pathname.list();A.) FIlelnputStreamB.) FileOutputStreamC.) FileD.) RandomAccessFileA.B.C.D.
[单选题]要向Applet传递参数,应该在下列drawing.html文件的下划线处填入的选项是……<applet code=DrawImage.class width=100 height=100></applet>……A.<param image,“flower.gif”>B.<param image value= flower .gif>C.<param name= image value=“flower .gif”>D.<param
[试题]( 11 )下列程序的功能是统计命令行参数的个数,请在下划线处填上适当的代码。public class Length{public static void main(String args[]){System.out.println( " number of String args: " +args. ( 11 ) );}}
[单选题]为使下列代码正常运行,应该在下划线处填入的选项是ObjectInputStream in=new_____(new FileInputStream(“employee . dat”));E.mployee[]newStaff=(Employee[〕)in.readObject();in .cIose();A.ReaderB.InputStreamC.ObjectInputD.ObjectInputStream
[单选题]在下列代码中应填入下划线中的是______。public class FirstSample{public static void maim(______args[]){System.out.println(“你好!”);}}A.) staffB.) doubleC.) IntD.) StringA.B.C.D.
[试题]( 11 )在下列程序的下划线处,填入适当语句使程序能正确执行并输出异常栈信息。public class ThrowableException{public static void main(String args[]){try{throw new Throwable(" 这里是本人定义的异常 ");}catch(Throwable e){System.out.println("Caught Throwable");System.out.println("e.getMessage():