下列程序的运行结果是 class Demo{ private String name; Demo(String……
下列程序的运行结果是 class Demo{ private String name; Demo(String name){this.name = name;} private static void show(){ System.out.println(name) } public static void main(String[] args){ Demo d = new Demo(“lisa”); d.show(); } } A.
输出lisa B.
输出null C.
输出name D.
编译失败,无法从静态上下文中引用非静态变量name