Merge pull request #111 from LOUSANPANG/main

docs(class):correction words
This commit is contained in:
Ruan YiFeng
2024-06-28 18:55:31 +08:00
committed by GitHub

View File

@@ -471,7 +471,7 @@ interface Swimmable {
// ...
}
interface SuperCar extends MotoVehicle,Flyable, Swimmable {
interface SuperCar extends MotorVehicle,Flyable, Swimmable {
// ...
}
@@ -570,7 +570,7 @@ const c1:Car = new Car();
const c2:MotorVehicle = new Car();
```
上面示例中,变量的类型可以写成类`Car`,也可以写成接口`MotorVehicle`。它们的区别是,如果类`Car`有接口`MotoVehicle`没有的属性和方法,那么只有变量`c1`可以调用这些属性和方法。
上面示例中,变量的类型可以写成类`Car`,也可以写成接口`MotorVehicle`。它们的区别是,如果类`Car`有接口`MotorVehicle`没有的属性和方法,那么只有变量`c1`可以调用这些属性和方法。
作为类型使用时,类名只能表示实例的类型,不能表示类的自身类型。