题目内容

程序运行后times的值是()?public class Test { public static void main(String[] args) { Count myCount = new Count(); int times = 0; for (int i=0; i<100; i++) increment(myCount, times); System.out.println("times = "+ times); } public static void increment(Count c, int times) { c.count++; times++; }}class Count { int count; Count(int c) { count = c; } Count() { count = 1; }}A:101B:100C:1D:03.给定如下程序:(B)3. public class Navel {4. private int size = 7;5. private static int length = 3;6. public static void main(String[] args) {7. new Navel().go();8. }9. void go() {10. int size = 5;11. System.out.println(new Gazer().adder());12. }13. class Gazer {14. int adder() { return size * length; }15. }16. }运行结果为?

A. 15
B. 21
C. 抛出异常
D. 由于多个error编译出错

查看答案
更多问题

Java语言与C++语言相比,最突出的特点()

A. 面向对象
B. 有类库
C. 高性能
D. 跨平台

以下语句哪个用于创建线程池?()

A. ExecutorService executor = Executors.newCachedThreadPool();
B. ExecutorService executor = Executors.newCachedThreadPool(1);
C. ExecutorService executor = Executors.newCachedThreadPool(2);
D. ExecutorService executor = Executors.newCachedThreadPool(3);

以下哪条语句输出smith\exam1\test.txt()

A. System.out.println("smith\exam1\test.txt");
B. System.out.println("smith\\exam1\\test.txt");
C. System.out.println("smith\"exam1\"test.txt");
D. System.out.println("smith"\exam1"\test.txt");

方法()用来获取文本控件jtf上的内容

A. jtf.getText(s)
B. jtf.getText()
C. jtf.getString()
D. jtf.findString() 运行下列代码会出现什么结果? (A) public class Ref{ public static void main(String argv[]) { Ref r = new Ref(); r.amethod(r); } public void amethod(Ref r){ int i=99; multi(r); System.out.println(i); }

答案查题题库