更多"在下列Java Applet程序的下划线处填入代码,使程序三整并能够正"的相关试题:
[填空题]在下列Java Applet程序的下划线处填入代码,使程序三整并能够正确运行。
importjava.applet.*;
importjava.awt.*;
publicclassHelloWofil______
publicvoidpaint(Graphicsg)
g.drawstring("HelloWorld!",25,25);
[填空题]
在下列Java Applet程序的下划线处填入代码,使程序完整并能够正确运行。
import java.applet.*;
import java.awt.*;
public class HelloWorld () {
public void paint(Graphics g){
g.drawString("Hello World!",25,25);
}
}
[填空题]请在下划线处填入代码,使程序能够正确运行。 import java .awt.*; import java .applet.*; public class SayHi extends Applet{ public void【15】(Graphics g){ g .drawString(“Hi!”20,20); } }
[填空题]在下面Java applet程序的横线处填入代码,使程序完整并能够正确运行。
import java.awt. *:
import java.applet.*;
public class Greeting extends Applet {
public void ______ (Graphics g) {
g.drawString("how are you!",10,10);
}
}
[填空题]在下面Java applet程序的横线处填入代码,使程序完整并能够正确运行。
import java.awt. *:
import java.applet.*;
public class Greeting extends Applet
public void ______ (Graphics g)
g.drawString("how are you!",10,10);
[填空题]在下列Java applet程序的横线处填入代码,使程序完整并能够正确运行。
Import java.awt.*;
Import java.applet.*;
Public class Greeting extends applet
Public void______(Graphics g)
g.drawSting("how are you!",10,10)______
[填空题]
在下列Java applet 程序的横线处填入代码,使程序完整并能够正确运行。
Import java. awt. *;
Import java. applet. *;
Public class Greeting extends applet{
Public void 【8】 (Graphics g) {
g.drawSting(“how are you!”,10,10);
}
}
[填空题]
清在下划线处填入代码,使程序正常运行并且输出“Hello!”
classTesl______{
publicstaticvoidmain(string[]args){
Test=newTest( );
t.start( );
}
Pubhcvoidrun( ){
System.out.println("Hello!");
}
}
[填空题]在下列Java Applet程序的下画线处填入代码,使程序完整并能够正确运行。
import java.applet.*;
import java.awt.*;
public class HelloWorld______
public void paint(Graphics g)
g.drawString("Hello World!",25,25);
[填空题]
下列程序构造了一个SwingApplet,请在下划线处填入正确的代码:
import javax.swing0*;
impon java.awt.*;
public class SwingAppletextends______{
JLabell=newJLabel("ThisisaSwingApplet.");
publicvoidinit( ){
ContainercontentPane=getContentPane( );
contentPane.add(1);
}
}
[单项选择]下列代码的下划线处应填入的方法名是
import java.applet.*;
import java.awt.*;
public class Hello extends Applet {
public void ________(Graphics g){
g.drawString("How are you!", 10, 10);
}
}
A. repaint
B. println
C. paint
D. show
[填空题]下列程序创建了一个线程并运行,请在下划线处填入正确代码。 public class Try extends Thread{ public static void main(String args[]){ Threadt=new Try(); 【13】; } public void run(){ System.out.println(“Try!”); } }
[填空题]在下列Javaapplet程序的横线处填入代码,使程序完整并能够正确运行。
Importjava.awt.*;
Importjava.applet.*;
PublicclassGreetingextendsapplet
Publicvoil______(Graphics g)
g.drawSting(“howareyOU!”,10,10);
[单项选择]在下列代码的下划线处应填入的内容是
public class FirstSample {
public static void main(________args[]) {
System.out.println("你好!");
}
}
}
A. staff
B. double
C. int
D. String
[填空题]在下列程序的下划线处,填入适当语句使程序能正确执行并输出异常栈信息。
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( ): "+e.getMessage( ));
System.out.println("e.toString( ):"+e.toString( ));
System.out.println( "e.printStackTrace( ):");
【 】;}}}
[填空题]
在下列程序的下划线处,填入适当语句使程序能正确执行并输出异常栈信息。
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( ): "+e.getMessage( ));
System.out.println("e.toString( ):"+e.toString( ));
System.out.println( "e.printStackTrace( ):");
();}}}