[单选题]下列程序运行结果是( )public class Demo {public static void main(String[] args) { Demo demo = new Demo(); demo.show(new Car() { public void run() { System.out.println("demo run"); } });}public void show(Car c) { c.run();}}abstract class Car {public void run() { System.out.println("car run...");}}
广开题库
|
2023-11-01 15:14:03
|
12
[单选题]下列程序运行结果是( )public class Demo {public static void main(String[] args) { Demo demo = new Demo(); demo.show(new Car() { public void run() { System.out.println("demo run"); } });}public void show(Car c) { c.run();}}abstract class Car {public void run() { System.out.println("car run...");}}

A.car run
B.demo run
C.无结果
D.程序编译报错
查看答案

广东开放大学

形成性考核

您可能感兴趣的试题
TOP