网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

下列Applet程序中,指定s为字符串类型,将s绘制在屏幕上,请将程序补充完整。

import java.applet.Applet;

import java.awt.Craphics;

public class testl8_1 extends Applet {

______String s;

public void init ()

{

s=new String("Hello World");

}

public Void______(Graphics g) {

g.______(s,10,25);

}

}


参考答案

更多 “ 下列Applet程序中,指定s为字符串类型,将s绘制在屏幕上,请将程序补充完整。import java.applet.Applet;import java.awt.Craphics;public class testl8_1 extends Applet {______String s;public void init (){s=new String("Hello World");}public Void______(Graphics g) {g.______(s,10,25);}} ” 相关考题
考题 下列Application程序中,指定v为32位整数类型,求出v的绝对值并输出,请将程序补充完整。class test19_1 {public static void main(String args[]) {______v=-100;char ch=______Math.______(v);System.out.println("ch="+ch);}}

考题 下列Application程序中,指定as为字符串数组类型,先创建一个HashSet对象并赋值,然后在屏幕输出s,请将程序补充完整。import java.util.*;public class test17_1{public static void main(String[] args){__________s=new HashSet();s.add("Hello");s.add("World");s.add(new Character('我'));s.add(new Integer(23));s.add("Hello");__________as={"W","o","r","1","d"};s.add(as);s.add(null);s.add(new Integer(23));s.add(null);System.out.println(__________);

考题 下列程序中,实现将封装数据类型Integer和基本数据类型int之间的转换,以及Integer,int类型和String类型之间的转换。请将程序补充完整。程序运行结果如下:123456456public class ex7_1{public static void main(String[]args) {Integer intObj;int n;String s;intObj = new Integer(123);n=intObj.__________;System.out.printin(Integer.toString(n));s=new String("456");intObj=Integer._________;System.out.println(intObj.__________);n=Integer.parseInt(s);System.out.println(Integer.toString(n));}}

考题 下列程序的输出结果为2,请将程序补充完整。 include using namespace std; class Basc 下列程序的输出结果为2,请将程序补充完整。include<iostream>using namespace std;class Basc{public:【 】void fun(){cout<<1;}};class Dcrived:public Base{public:void fun(){cout<<2;}};int main(){Base*p=new Derived;p->fun();delete p;return 0;}

考题 请将下面的Applet程序补充完整。import java. awt. *;import java. applet. *;public class Hi【 】{public void paint(Graphics g){g. drawString("Hi!", 25, 25);}}

考题 下列程序的输出结果为2,请将程序补充完整。 include using namespace std; class Base 下列程序的输出结果为2,请将程序补充完整。include<iostream>using namespace std;class Base{public:______void fun(){cout<<1;}};class Derived:public Base{public:void fun(){cout<<2;}};int main(){Base*p=new Derived;p->fur();delete p;return 0;}

考题 下列程序中,要求从键盘接受字符输入,直到输入字符为“e”(注意是小写)时停止,并且将输入的字符(“e”之前的字符)显示在屏幕上。请将程序补充完整。程序运行结果如下:Keep typing,it will stop while enter 'e'...ddfsofkjlvncozieowdsfadsfddfsofkjlvncoziimport java.io.*;public class ex4_1 {public static void main(String[] args) {char ch;System.out.println("Keep typing,it will stop while enter 'e'...");try{while((ch= _______)!='e'){System._______;}}catch(IOException Joe){System._______;}}}

考题 下列程序的输出结果为2,请将程序补充完整。 include using namespaee std; class B 下列程序的输出结果为2,请将程序补充完整。include <iostream>using namespaee std;class Base{public:______void fun( ){cout<<1;}};class Derived:public Base{public:void fun( ){cout<<2;}};int main( ){Base*P=new Derived:p->fun( );delete P;return 0;}

考题 在编写Applet程序时,程序中必须有的import语句是A.import.java.io.*;B.import java.applet.Applet;C.import.java.awt.event.*;D.import.java.lang.*;