多项选择题
在Java语言中,下列语句能通过编译的是()。
A.String s = "john" + " was " + " here";
B.String s = "john" + 3;
C.int a = 3 + 5;
D.int a = 5 + 5.5;
点击查看答案&解析
相关考题
-
单项选择题
在Java中,下列选项表示字符“a”值的是()。
A.’a’
B."a"
C.new Character(a)
D.\000a -
多项选择题
在Java中,下列方法()是一个String对象所具有的。
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.运行时错误
