单项选择题
当Applet程序中的init()方法为下列代码时,运行后用户界面会出现什么样的情况。
public void init()
setLayout(new BorderLayout());
add("North", new TextField(10));
add("Center", new Button("help"));
下面各选项中描述正确的是( )。
A.文本框将会出现在Applet的顶上,且有10个字符的宽度
B.按钮将会出现在Applet的正中间,且尺寸为正好能够包容help的大小
C.文本框将会出现在Applet的顶上,从最左边一直延伸到最右边;按钮将会出现在Applet的正中央,覆盖除文本框外的所有空间
D.按钮与文本框的布局依赖于Applet的尺寸
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
设有如下程序: public class Sun public static void main(String args[ ]) int x, y; x-4; y=0; if(Math.pow(x,2)==16) y=x; if(Math.pow(x,2)<15) y=1 x; if(Math.pow(x,2)>15) y=(int)Math.pow(x,2)+1; System.out.println(y); 程序的运行结果是( )。
A.4
B.17
C.18
D.0.25
点击查看答案&解析
单项选择题
有下面程序段: Public class ArrayTest Public static void main(String args[]) int[] intArray=new int[3]; for(int I=0;I<3;I++) intArray[I]=I+2; System.out.println( IntArray[ +I+ ] - +intArray[I]); System.out.println( ------------ ); Int arrLen=4; IntArray=new int[arrLen]; For(int j=intArray.length;j>=0;j-- intArray [j]=j*3; System. out.println( hello +intArray[j]); 则运行的结果是( )。
A.编译出错
B.编译通过,但运行出错
C.可以运行,但有错误
D.以上都不对
点击查看答案&解析
相关试题
下列代码的执行结果是( )。 public cl...
下面for循环语句的执行结果是( )。 for...
有下面程序段: Public class ArrayTest...
设有如下程序: public class Sun publ...
下面对对象概念描述错误的是( )。