A.程序可以运行,且看到显示
B.程序编译出错
C.程序可以运行,但看不到显示
D.以上说法不对
[单选题]关于下面的程序段,说法正确的是 import java.awt.*; import java.applet.*; public class Test extends Applet{ Canvas MyCanvas; public void init(){ MyCanvas=new Canvas(); MyCanvas.setBackground(Color.cyan); add(MyCanvas); } }A.程序可以运行,且看到显示B.程序编译出错C.程序可以运行,但看不到显示D.以上说法都不
[主观题]将下面Applet程序补充完整。import java.awt.*:import java.apptet.*;public class Hi ______ {public void paint(Graghics g) {g.drawstring("Hi!",2.5,2.5);}}
[单选题]下面程序代码运行结果为( )。 import java.awt.*; public class Test { public static void main (String args[]) { String s1="a+b+c"; String s2="+"; int i=s1.lastIndexOf (s2); System.out.println(i); } }A.0B.1C.2D.3
[单选题]关于下面程序段的说法,正确的是 import java.applet.*; import java.awt.*; public class Test extends Applet{ Image IMG nClick=over(this) title=放大; public void init(){ IMG nClick=over(this) title=放大=new Image(); } public void paint(Graphics g){ g.drawImage(IMG nClick=o
[单选题]下面程序的输出结果是( )。 import java. awt.*; import java. applet.*; public class HelloApplet extends Applet { public void paint(Graphics g) { g.drawString("Hello World! ",20,20); } }A.20,20B.Hello World!C.编译不能通过D.以上都不对
[单选题]关于下面程序段的说法,正确的是 import javA.applet.*; import java.awt,*; public class Test extends Applet { Image IMG nClick=over(this) title=放大; public void init(){ IMG nClick=over(this) title=放大=new Image(); } public void paint(Graphics g){ g.drawlmage(IMG nClick=
[单选题]下列代码中的内部类名是______。import java.awt.event.*;import javax.swing.*;class Talkingclock{public void start (int interval, final boolean beep){A.ctionListener listener=newA.ctionListener(){public void actionPerformed (ActionEvent event) {......}}Timer t=new
[单选题]分析下面的Java程序段输出结果为()。A . Caught in main()B . Caught in main()nothingC . nothingD . 没有任何输出
[单选题]( 16 )阅读下面程序import java.io.*;public class TypeTransition{public static void main(String args[]){char a = 'h';int i = 100;int j = 97;int aa = a + i;System.out.println("aa="+aa);char bb = (char)j;System.out.println("bb="+bb);}}如果输出结果的第二行为 bb=a ,那
[单选题]阅读下面程序import java.io.*;public class ByteStream Test{public static void main(String[] a){int[] myArray = {10,20.30,40};try{D.ataOutputStream dos = new DataOutputStream(new _________________( " ints.dat " ));for (int i=0;i<myArray.length;i++)dos.w