A.String s = "john" + " was " + " here";
B.String s = "john" + 3;
C.int a = 3 + 5;
D.int a = 5 + 5.5;
您可能感兴趣的试卷
你可能感兴趣的试题
A.’a’
B."a"
C.new Character(a)
D.\000a
A.equals(Object)
B.trim()
C.round()
D.toString()
public class Holt extends Thread{ private String sThreadName;
public static void main(String argv[]){
Holt h = new Holt();
h.go(); }
Holt(){}
Holt(String s){
sThreadName = s; }
public String getThreadName(){
return sThreadName; }
public void go(){
Holt first = new Holt("first");
first.start();
Holt second = new Holt("second");
second.start(); }
public void start(){
for(int i = 0; i < 2; i ++){
System.out.println(getThreadName() +i);
try{
Thread.sleep(100); }
catch(InterruptedException e){
System.out.println(e.getMessage());
}
} } }
当编译运行上面的Java代码时,将会出现()。
A.编译时错误
B.输出first0, second0, first0, second1
C.输出first0, first1, second0, second1
D.运行时错误
public class test3 {
public static void main(String args[]) {
for(int i = 0; i < 3; i++) {
for(int j = 3; j >= 0; j--) {
if(i == j)
continue;
System.out.println("i="+ i + " j="+j);
}
}
}
}
上面的Java代码编译运行后,下列选项中,()会出现在输出结果中。
A.i=0 j=3
B.i=0 j=0
C.i=2 j=2
D.i=0 j=2
E.i=1 j=2
import java.awt.*;
import java.applet.*;
public class ButtonDemo extends Applet{ public void init() {
Button pushBotton=new Button("ok");
Button downBotton=new Button("Yes");
add(pushBotton);
add(downBotton); } }
根据以上代码,下列解释正确的是()。
A.该代码画了一个按钮
B.Button("ok")创建一个有显示"ok"的按钮
C.Button()是构造函数
D.按钮属于容器
A.getActionCommand()
B.setLabel(string str)
C.button()
D.getLabel()
A.image是要绘制的图像
B.x,y是表示图像的中心的位置
C.width是源图像的宽度
D.this是容器
A.if ( i > 10 ) throw Exception(“something’s wrong!”);
B.if ( i > 10 ) throw Exception e (“something’s wrong!”);
C.if ( i > 10 ) throw new Exception(“something’s wrong!”);
D.if ( i > 10 ) throw new Exception e ("something’s wrong!");
A.若用户从applet运行的页移动到其它页,stop()方法就会停止第一页中的applet
B.若用户从applet运行的页移动到其它页,stop()方法不会停止第一页中的applet
C.使用destroy()方法可将applet从内存中永久删除
D.destroy()方法可以删除运行的applet所有使用的资源
A.FlowLayout以由上到下的方式从左到右排列组件
B.BorderLayout使用”东”、”西”、”南”、”北”,”居中”来指定组件的位置
C.GridLayout提供了类似于选项卡式的对话框的功能
D.CardLayout是最灵活的布局方案
最新试题
标记属性描述正确的是()
Hibernate关联维护中关于“一对多/多对一”描述正确的是()
Hibernate中关于使用查询语句描述正确的是()
在Java语言中,下列组件可以让用户选择多个选项有()。
Hibernate关联维护中关于“inverse”描述正确的是()
在Java语言中,为了使用getImage的方法,你需要导入的类是()。
Struts通过()支持MVC的视图开发
Struts中Logic标记库定义的标记能够执行下列哪些功能()
在Hibernate 中关于数据库表主键,正确的说法有()
Hibernate关联维护中关于“一对一”描述正确的是()