题目内容

下列代码运行不可能出现的结果是:public static void main(String args[]){Random random = new Random();int ran = random.nextInt(3);System.out.println("产生的结果为: "+ran);}

A. 产生的结果为:0
B. 产生的结果为:3
C. 产生的结果为:1
D. 产生的结果为:2

查看答案
更多问题

给出下面的代码运行结果:public static void main(String args[]) {Set ts = new TreeSet();ts.add("a");ts.add("c");ts.add("b");Iterator it = ts.iterator();while(it.hasNext()){System.out.print(it.next());}}

A. acb
B. bac
C. abc
D. 编译错误

下列哪个方法不是线程类的:

A. run()
B. start()
C. close()
D. 以上说法都不对

下面程序运行的结果是( )String str = “abcdefg”;System.out.println(str.substring(0,2));

A. ab
B. abc
C. abcdefg
D. 出现下标越界异常

List,Set,Map是继承自Collection接口

A. 对
B. 错

答案查题题库