题目内容

Runtime类的实例化,下面说法正确的是

A. Runtime rt=new Runtime();
B. Runtime rt=Runtime.getRuntime();
C. Runtime rt=Runtime.createRuntime();
D. Runtime rt=System.getRuntime();

查看答案
更多问题

Java中使用Math类获取1-10之间的随机整数,正确的是

A. int m=Math.randomInt(10)+1;
B. int m=Math.random(10);
C. int m=(int)(Math.random()*10)+1;
D. int m=Math.random()*10;

将String str="2935"; 转换为整数2935,正确写法是

A. int m=String.toInt(str);
B. int m=Integer.parseInt(str);
C. int m=String.parseInt(str);
D. int m=Integer.intValue(str);

HashSet集合类型存储的对象不允许重复,但是存储的顺序还是和存入的顺序一致。

A. 对
B. 错

Java的异常处理机制目标是为了在程序中,避免出现运行时异常。

A. 对
B. 错

答案查题题库