C#中Car为一自定义类,其中有以下方法定义public void Auto(){…}使用以下语句创建了该类的一个对象c1:Car c1=new Car();那么,调用Car的Auto方法为
A: c1.Auto()
B: c1::Auto
C: Car.Auto()
D: Car::Auto()
A: c1.Auto()
B: c1::Auto
C: Car.Auto()
D: Car::Auto()
举一反三
- 若已定义Car类,该类具有一个无参构造方法和一个带int型参数的有参构造方法,则下述语句中不能正确创建对象的是()。 A: Car myCar; B: Car myCar=new Car(); C: Car myCar;myCar=new Car(5); D: Car myCar=new Car(5);
- People who don’t have a car usually ______ (choice) to rent one from Auto Driveaway.
- 假设有一个类 Car ,则可以使用 dim c as new car 定义类的对象的语法格式( )。
- When it came to fixing the car, the author___________________. A: had full confidence in his auto repairman B: had doubts about his auto repairman's ability C: listened to God's advice D: had no idea who he should turn to for help
- 下列程序运行结果是( ) 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..."); } }
