[单项选择题] 阅读下面代码 public class Test {  String s="One World One Dream";  public static void

10 查阅

[单项选择题] 阅读下面代码 public class Test {  String s="One World One Dream";  public static void main(String[] args) {   System.out.println(s);  } } 其运行的结果是

A.args

B.One World One Dream

C.s

D.编译时出错

参考答案:

D

本程序在静态方法main()中访问了非静态变量s,因此编译错误。

计算机考试