题目内容

关于System类的currentTimeMillis()方法,下面说法正确的是

A. 这个方法表示运行语句花费的系统时间,返回Date类型
B. 这个方法表示运行语句花费的系统时间,返回long类型
C. 这个方法用来获取当前系统的时间,返回Date日期时间对象类型
D. 这个方法用来获取当前系统的时间,返回long类型的毫秒值

查看答案
更多问题

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. 错

答案查题题库