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),包含的属性有:颜色(color)、型号(type)、品牌(brand)。现在小强要在main( )方法中创建Car类的对象,在他的编码中,( )是正确的。 A: Car myCar=new Car(); myCar color="黄色”; B: Car myCar=new Car(); myCar.brand="宝马"; C: Car myCar; myCar.color="黄色"; D: Car myCar=new Car(); color="黄色";
- 假设有一个类 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