Skip to content

docs(class):correction words #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/class.md
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ interface Swimmable {
// ...
}

interface SuperCar extends MotoVehicle,Flyable, Swimmable {
interface SuperCar extends MotorVehicle,Flyable, Swimmable {
// ...
}

Expand Down Expand Up @@ -570,7 +570,7 @@ const c1:Car = new Car();
const c2:MotorVehicle = new Car();
```

上面示例中,变量的类型可以写成类`Car`,也可以写成接口`MotorVehicle`。它们的区别是,如果类`Car`有接口`MotoVehicle`没有的属性和方法,那么只有变量`c1`可以调用这些属性和方法。
上面示例中,变量的类型可以写成类`Car`,也可以写成接口`MotorVehicle`。它们的区别是,如果类`Car`有接口`MotorVehicle`没有的属性和方法,那么只有变量`c1`可以调用这些属性和方法。

作为类型使用时,类名只能表示实例的类型,不能表示类的自身类型。

Expand Down